reference

Every knob

One object. Accepted by createField, both component bindings, and update().

01 — options

preset

FieldPreset

Applies a bundle of the options below. Anything passed alongside it wins.

default 'clouds'

generator

'noise' | 'cells' | 'rings' | 'waves' | 'grid' | 'spiral'

Which scalar field feeds the dither.

default 'noise'

falloff

'up' | 'down' | 'fill'

Vertical density ramp.

default 'down'

mode

'fbm' | 'ridged' | 'billow'

Shapes the sample. Ridged inverts the midpoint, billow folds it.

default 'fbm'

scale

number

Frequency multiplier.

default 1

aspect

number

Anisotropy. Below 1 squashes horizontally, above 1 stretches vertically.

default 1

warp

number

Domain warp strength. 0 is clean, 2.5 is turbulence.

default 1

contrast

number

Narrows the tonal window toward hard edges.

default 1

speed

number

Time multiplier.

default 1

flow

{ x: number; y: number }

Constant drift applied to the sampling origin.

default { x: 0, y: 0 }

seed

number

Offsets the field and its start time.

default 0

intensity

number

Multiplies the palette index before dithering.

default 1

theme

'light' | 'dark'

Picks the built in palette. Ignored when tint or palette is set.

default 'dark'

tint

string

Hex colour. Derives a seven step ramp around it.

default —

palette

Uint32Array

Your own packed ramp. Index 0 must be fully transparent.

default —

interactive

boolean

Pointer bump near the cursor.

default true

playing

boolean

Stops the loop. The last frame stays.

default true

fps

number

Render cap.

default 24

02 — preset values

Nothing hidden

presetgeneratorfalloffmodescaleaspectwarpcontrastspeedflow
cloudsnoisedownfbm111110,0
fognoisefillfbm0.550.50.50.60.456,0
streaksnoisefillbillow1.50.30.751.251.218,0
terrainnoisefillridged1.110.352.40.20,0
plasmanoisefillfbm0.912.41.32.40,0
smokenoiseupfbm1.151.51.70.951.10,-20
nebulanoisefillridged0.6211.52.10.30,0
staticnoisefillfbm3.4103.23.20,0
auroranoiseupridged0.80.351.91.80.79,0
marblenoisefillridged1.312.630.150,0
cellscellsfillfbm110.610.60,0
crackscellsfillridged110.22.20.20,0
bubblescellsupbillow111.10.81.10,-6
mosaiccellsfillbillow1101.60.080,0
rippleringsfillfbm110110,0
sonarringsfillridged0.7102.40.60,0
dropletringsfillbillow1.610.91.51.50,0
moirewavesfillfbm2.4102.80.50,0
silkwavesfillfbm0.8510.450.850.80,0
currentwavesfillbillow1.511.11.51.40,0
checkergridfillfbm1102.60.34,0
weavegridfillridged1.610.31.40.50,0
circuitgridfillbillow0.711.22.80.40,0
vortexspiralfillfbm110.4110,0
galaxyspiralfillridged111.11.60.350,0
portalspiralfillbillow110.22.61.80,0

clouds

Soft fbm billows gathering at the top edge.

fog

Low frequency haze that barely moves.

streaks

Squashed billow noise pushed sideways. Interference, not water.

terrain

Ridged noise at high contrast. Sharp veins.

plasma

Warp and time at 2.4. The domain eats itself.

smoke

Stretched vertically, drifting up into the ceiling.

nebula

Ridged at low frequency. Structure without edges.

static

No warp, frequency past the pixel grid.

aurora

Ridged bands squashed flat and drifting sideways.

marble

Heavy warp on ridged noise, almost still.

cells

Voronoi edges wobbling against each other.

cracks

Inverted cell edges at high contrast.

bubbles

Cell bodies rising and fading out of the top.

mosaic

Flat voronoi tiles, nearly frozen.

ripple

Concentric rings expanding from the centre.

sonar

Hard ringed sweep at low frequency.

droplet

Tight folded rings with a warped centre.

moire

Three sine waves crossing at high frequency.

silk

Soft low frequency interference.

current

Folded waves with heavy warp.

checker

Clean checkerboard drifting sideways.

weave

Interlocked grid lines from a ridged fold.

circuit

Warped grid broken into traces.

vortex

Two spiral arms turning from the centre.

galaxy

Ridged spiral arms with a soft core.

portal

Fast folded spiral with a hard rim.

03 — handle & exports

Two methods

vanilla
const field = createField(canvas, { preset: 'terrain' });

field.update({ warp: 2.2 });
field.destroy();
  • update merges options, rebuilds the palette and ramp, redraws. Never rebuilds the noise tables.
  • destroy cancels the frame, disconnects the ResizeObserver, removes every listener.

createField

(canvas, options?) => FieldHandle

Mounts the renderer. Draws one frame synchronously.

PRESETS

Record<FieldPreset, PresetShape>

Every preset and its exact values.

PRESET_NAMES

FieldPreset[]

All 26 names, in catalogue order.

GENERATOR_NAMES

FieldGenerator[]

The six scalar field families.

packPalette

(colors) => Uint32Array

Packs RGBA tuples into the compositor layout.

paletteFromTint

(hex, theme) => Uint32Array

Builds the seven step ramp. Throws on a non hex value.