Skip to content

ghost

ghost(tex, uv, offsets, baseOpacity, fadeWithDistance): Node<"vec4">

Defined in: packages/nodes/src/vfx/afterimage.ts:108

Multiple ghost/clone effect at offset positions. Creates several semi-transparent copies at fixed offsets.

Parameters

tex

Texture

Source texture

uv

Node<"vec2">

UV coordinates

offsets

[number, number][]

Array of offset positions for ghosts

baseOpacity

FloatInput = 0.3

Opacity of each ghost (default: 0.3)

fadeWithDistance

boolean = true

Fade ghosts based on offset distance

Returns

Node<"vec4">

Color with ghost clones

Example

const ghosts = ghost(texture, uv, [[0.02, 0], [0.04, 0], [0.06, 0]], 0.3)