SlidingDoorMaterial
The SlidingDoorMaterial multiplies your text into a series of segmented panes. As
the effect animates, copies of your text slide in stunted progression within and outside their
individual frames, appearing to drag each other along as they move. The resulting effect is
that your text splits and reorganizes itself, again and again in an endless loop.
SlidingDoorMaterial extends Material, and therefore has the same
properties and functions as Material.
-
construction
import { SlidingDoorMaterial } from "blotter.ts/materials"; const material = new SlidingDoorMaterial(); -
uniforms
material.uniformsAn object that holds the uniforms that describe how the material's effects should be rendered. Each entry is a live
UniformInterface: assign to itsvalueand the running effect updates. You should not replace this property directly.-
uDivisions
material.uniforms.uDivisionsThe
uDivisionsuniform describes the number of panes to separate your text into, along the animation axis. By default, your text animates vertically and therefore the value of theuDivisionsuniform describes a number of divisions along the Y axis. However, when the value of theuAnimateHorizontaluniform is more than0.0the value of theuDivisionsuniform describes a number of divisions along the X axis.-
value
material.uniforms.uDivisions.valueAny floating point value is acceptable.
The default value is
5. -
type
material.uniforms.uDivisions.typeThe uniform type of the value being passed to the shader.
"1f"means the value is a single float (e.g.0.5). You should not change this property.
-
-
uDivisionWidth
material.uniforms.uDivisionWidthConsider the panes of your text, each separately sliding, one after the other, out of and back into their original positions. As each pane follows its predecessor, it does so on a delay, waiting for the previous pane to animate some number of pixels before its own animation begins. The distance each pane covers before its descendant begins animating is described by the
uDivisionWidthuniform.-
value
material.uniforms.uDivisionWidth.valueA floating point value between
0.0(0%) and1.0(100%), relative to the height of your text (including any padding and line height).The default value is
0.25. -
type
material.uniforms.uDivisionWidth.typeThe uniform type of the value being passed to the shader.
"1f"means the value is a single float (e.g.0.5). You should not change this property.
-
-
uAnimateHorizontal
material.uniforms.uAnimateHorizontalBy default,
SlidingDoorMaterialassumes that animation within its effect takes place along the vertical (Y) axis. TheuAnimateHorizontaluniform serves as a boolean (true/false) value, meant to tell the effect whether or not to animate along the horizontal (X) axis.-
value
material.uniforms.uAnimateHorizontal.valueA floating point value. Either
0.0(false) or1.0(true).The default value is
0. -
type
material.uniforms.uAnimateHorizontal.typeThe uniform type of the value being passed to the shader.
"1f"means the value is a single float (e.g.0.5). You should not change this property.
-
-
uFlipAnimationDirection
material.uniforms.uFlipAnimationDirectionBy default,
SlidingDoorMaterialanimates your text in a predetermined direction, depending on the value of theuAnimateHorizontaluniform. When the value of theuAnimateHorizontaluniform is equal to0.0and your text is animating vertically, your text will animate from bottom to top by default. When the value of theuAnimateHorizontaluniform is more than0.0and your text is animating horizontally, your text will animate from right to left by default. TheuFlipAnimationDirectionuniform serves as a boolean (true/false) value, meant to tell the effect whether or not to invert animation along the axis determined by theuAnimateHorizontaluniform.-
value
material.uniforms.uFlipAnimationDirection.valueA floating point value. Either
0.0(false) or1.0(true).The default value is
0. -
type
material.uniforms.uFlipAnimationDirection.typeThe uniform type of the value being passed to the shader.
"1f"means the value is a single float (e.g.0.5). You should not change this property.
-
-
uSpeed
material.uniforms.uSpeedThe
uSpeeduniform describes the speed of the animation of the panes of theSlidingDoorMaterial.-
value
material.uniforms.uSpeed.valueAny floating point value is acceptable. This value acts as a multiplier against the default uniform passed to all effects,
uGlobalTime, which represents the time in seconds since the effect started. Therefore, smaller values slow animation while higher values speed up animation. Play around, you'll get the idea.The default value is
0.2. -
type
material.uniforms.uSpeed.typeThe uniform type of the value being passed to the shader.
"1f"means the value is a single float (e.g.0.5). You should not change this property.
-
-