Skip to content

sparkle

sparkle(inputColor, uv, time, density, intensity, sparkleColor, speed, threshold): Node<"vec4">

Defined in: packages/nodes/src/vfx/sparkle.ts:30

Add sparkle/glitter effect to a color. Creates randomly appearing bright spots that twinkle over time.

Parameters

inputColor

Node<"vec4">

Base color (vec4)

uv

Node<"vec2">

UV coordinates

time

FloatInput

Animation time

density

FloatInput = 50

Sparkle density (higher = more sparkles, default: 50)

intensity

FloatInput = 2

Sparkle brightness (default: 2)

sparkleColor

Vec3Input = ...

Color of sparkles (default: white)

speed

FloatInput = 3

Animation speed (default: 3)

threshold

FloatInput = 0.97

Sparkle appearance threshold (default: 0.97)

Returns

Node<"vec4">

Color with sparkle effect

Example

const sparkly = sparkle(inputColor, uv, time, 40, 2, [1, 1, 1])