dithered

Adds a tiny amount of noise to a final color so long soft gradients show no banding.

dithered(color: Expr, params: GpuFragmentParams): Expr

Import compose from shaders/std and use compose.dithered.

Apply it to the finished rgba, never to a value that still feeds a palette.

Parameters

NameTypeNotes
colorExpr
paramsGpuFragmentParams

Example

paint: (params) => dithered(standardPalette(field, params), params)

See also

  • emissiveAlpha — Turns an rgb light value into a color with alpha, so glows composite over transparency.

Used by

MeshGradient