afterimage
afterimage(
currentColor,previousTex,uv,persistence?):Node<"vec4">
Defined in: packages/nodes/src/vfx/afterimage.ts:20
Create afterimage/ghost effect by blending with a previous frame. Requires a texture containing the previous frame.
Parameters
Section titled “Parameters”currentColor
Section titled “currentColor”Node <"vec4">
Current frame color
previousTex
Section titled “previousTex”Previous frame texture
Node <"vec2">
UV coordinates
persistence?
Section titled “persistence?”FloatInput = 0.8
How much previous frame persists (0-1, default: 0.8)
Returns
Section titled “Returns”Node <"vec4">
Blended color with afterimage
Example
Section titled “Example”// Render to texture, then use previous frameconst ghosted = afterimage(currentColor, previousFrameTexture, uv, 0.85)