BONEYARD · part · bay
Wash
src/43-wash.js · one module, no third-party code
ParametersFactory
How it works
When the grid arrives it is smoothed once with a 3 x 3 box and differenced (central differences, metres per metre) into a slope field. A drop moves opposite the slope, at a speed that grows with steepness up to a cap, plus a small curl-noise drift (the curl of a sum of sines, so it neither piles drops up nor spreads them out) that keeps the nearly flat basin from freezing. Drops live a few seconds and are reborn at random places in the view, or under the pointer, which is the rain cloud.
Trails live in a density grid the size of the elevation grid. Each step a drop adds weight equal to the distance it moved (so a drop stalled in a pit does not glow) times a factor S that grows every frame; dividing by S when drawing makes every older deposit fade exponentially without touching the buffer. On mount the model runs twenty seconds at a fixed step with a seeded random source, so the still is already full of canyons and the live bay continues from that exact state. Each frame maps the view window of the grid onto a buffer whose long side is 480 pixels: a faint hillshade in the tube's line colour, plus phosphor where the density is. Warm contour accents are derived from sampled elevation. A bounded set of bright moving heads follows the actual drops, with short tails from each last step. The explicit rain() action seeds drops in a cloud, draws its location immediately, and in Still advances a small deterministic batch without starting a ticker.
Provenance
- technique
- particle advection through a vector field: each drop steps along the downslope gradient of a real elevation grid plus a weak divergence-free curl noise, and leaves a decaying phosphor trail
- lineage
- vector-field particle advection and streakline plots in 1990s scientific visualization; the generative flow-field sketches that grew out of them
- original
- the field is the Santa Catalina Mountains (the same 768 x 768 grid RANGE flies), so Sabino, Bear, Ventana and Pima canyons draw themselves out of the front range in a few seconds; the pointer is a rain cloud; the trail buffer never fades by rewriting pixels (a growing deposit weight does the decay), so the twenty-second still is the same buffer the live bay keeps drawing into
- not
- hydrology: no flow accumulation, infiltration, channels, rainfall or discharge. It shows where water would run downhill on a 64 m surface, not where it does run
- deps
- none · Canvas 2D · 2026-09
- budget
- 1.18 ms/tick in a 1440x900 workbench; 1.50 ms/tick at 390x844 touch emulation, 2,400 drops; one-second local Chromium CPU samples, 2026-09-30, normal CPU rate; excludes GPU, raster and hardware phones
- api
- mount(canvas, params, ctx) -> { tick(dt, t, progress, pointer), resize(w, h, dpr), still(t), rain(nx, ny), destroy() }
- license
- MIT, Desert Data Labs LLC · elevation: Mapzen terrain tiles; data from SRTM, NED, and others
Budget: 1.18 ms/tick in a 1440x900 workbench; 1.50 ms/tick at 390x844 touch emulation, 2,400 drops; one-second local Chromium CPU samples, 2026-09-30, normal CPU rate; excludes GPU, raster and hardware phones