bayerDither
bayerDither(
inputColor,levels?,scale?,screenCoord?):Node<"vec4">
Defined in: packages/nodes/src/retro/bayerDither.ts:298
Apply Bayer matrix ordered dithering (defaults to 4x4). Alias for bayerDither4x4 as it’s the most commonly used pattern.
Parameters
Section titled “Parameters”inputColor
Section titled “inputColor”Node <"vec4">
The input color (vec4 with alpha)
levels?
Section titled “levels?”FloatInput = 2
Number of color levels per channel (default: 2 = binary)
scale?
Section titled “scale?”FloatInput = 1
Scale of dither pattern (default: 1)
screenCoord?
Section titled “screenCoord?”Node <"vec2">
Screen coordinates (use UV * textureSize for per-sprite)
Returns
Section titled “Returns”Node <"vec4">
Dithered color
Examples
Section titled “Examples”// Binary dithering (2-color)bayerDither(texture(tex, uv()), 2, 1, screenUV.mul(resolution))// 4-level dithering for retro lookbayerDither(color, 4)