trail
trail(
tex,uv,direction,length?,samples?,falloff?):Node<"vec4">
Defined in: packages/nodes/src/vfx/trail.ts:22
Create motion trail effect by sampling previous positions. Samples the texture at offset positions to create a trailing effect.
Parameters
Section titled “Parameters”Source texture
Node <"vec2">
Current UV coordinates
direction
Section titled “direction”Trail direction (normalized vec2 or [x, y])
length?
Section titled “length?”FloatInput = 0.1
Trail length in UV space (default: 0.1)
samples?
Section titled “samples?”number = 4
Number of trail samples (default: 4)
falloff?
Section titled “falloff?”FloatInput = 2
How quickly trail fades (default: 2)
Returns
Section titled “Returns”Node <"vec4">
Color with motion trail
Example
Section titled “Example”// Horizontal motion trailconst trailed = trail(texture, uv, [1, 0], 0.1, 4)