bayerDither4x4
bayerDither4x4(
inputColor,levels?,scale?,screenCoord?):Node<"vec4">
Defined in: packages/nodes/src/retro/bayerDither.ts:214
Apply 4x4 Bayer matrix ordered dithering. Standard dither pattern - good balance of quality and retro aesthetic.
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
Example
Section titled “Example”// 4-level dithering for retro lookbayerDither4x4(color, 4, 1, uv().mul(textureSize))