pixelGrid

Frames a field on the pixel grid: one value per block of grain device pixels.

pixelGrid(field: Field, slots: {grain: PropRef; seed: PropRef}): Field

Import noise from shaders/std and use noise.pixelGrid.

For patterns that live on pixels rather than on the canvas (blue noise, dither). grain is the block size in pixels (1 = every pixel), seed picks a different block of the pattern. The field inside gets whole-number pixel coordinates.

Parameters

NameTypeNotes
fieldField
slots{grain: PropRef; seed: PropRef}

Example

paint: rampOver(noiseTone(pixelGrid(blueSpeckle(), {grain: p('grain'), seed: p('seed')}), {contrast: p('contrast'), balance: p('balance')}), stops(p('colorSpace')))

See also

  • blueSpeckle — Fine, even speckle with no clumps: blue noise, one random value per pixel block.
  • seededPlane — Frames a field on a zoomable plane: how big the pattern is and where it starts.

Used by

BlueNoise