Skip to content

bayerDither2x2

bayerDither2x2(inputColor, levels?, scale?, screenCoord?): Node <"vec4">

Defined in: packages/nodes/src/retro/bayerDither.ts:173

Apply 2x2 Bayer matrix ordered dithering. Creates a coarse dither pattern - good for very low resolution retro effects.

Node <"vec4">

The input color (vec4 with alpha)

FloatInput = 2

Number of color levels per channel (default: 2 = binary)

FloatInput = 1

Scale of dither pattern (default: 1)

Node <"vec2">

Screen coordinates (use UV * textureSize for per-sprite)

Node <"vec4">

Dithered color

// Binary dithering on sprite
bayerDither2x2(color, 2, 1, uv().mul(textureSize))