pixelate
pixelate(
inputUV,resolution,pivot?):Node<"vec2">
Defined in: packages/nodes/src/sprite/pixelate.ts:25
Pixelate UV coordinates by snapping to a pixel grid.
Parameters
Section titled “Parameters”inputUV
Section titled “inputUV”Node <"vec2">
The UV coordinates to transform
resolution
Section titled “resolution”Pixel grid resolution as [width, height] or vec2 node
pivot?
Section titled “pivot?”Vec2Input = ...
Center point for pixelation (default: [0.5, 0.5] = center)
Returns
Section titled “Returns”Node <"vec2">
Pixelated UV coordinates (snapped to grid centers)
Examples
Section titled “Examples”// Pixelate to 16x16 grid (centered)pixelate(uv(), [16, 16])// Animate pixelation with uniform (stays centered)pixelate(uv(), resolutionUniform)// Pixelate from top-left cornerpixelate(uv(), [16, 16], [0, 1])