Saramsha

No. 062  ·  17 November 2026

No Grain Knows It's Building a Dune

Every grain here obeys two rules and nothing else: hop a fixed distance downwind, and tumble to a lower neighbour once a slope gets too steep. Neither rule mentions a ripple or a dune. Run enough grains long enough and both show up anyway — fine ripples first, and underneath them, slower, the crescent shape of a real barchan dune. Drag on the sand to pile some up or scrape some away and watch the wind go back to work on whatever you leave it.

Drag on the sand: add with the brush, hold Shift (or use two fingers) to scrape it away.

About this piece

A dune is just what erosion leaves behind

Nobody designs a sand dune. Wind picks grains up, carries them a short distance, and drops them — over and over, for years — and the crescent shape that results is simply the arrangement that survives that process best. In 1995 the physicist Brad Werner showed that a model with almost nothing in it besides "grains hop downwind" and "slopes above a critical angle collapse" reproduces real dune shapes and real dune physics closely enough to be taken seriously as an actual explanation, not just a pretty animation. This page runs a version of that model.

Each cell in the grid holds a stack height of sand. At every step, a cell with sand on it tries to send one grain a fixed distance downwind — that is the wind reach slider. But a grain can't be picked up at all if it is already sitting in the lee of something taller nearby, and a grain in flight lands the instant it crosses into such a shadow instead of completing its full hop. That single rule, applied over and over, is doing two jobs at once: it is why sand collects on the downwind side of any bump rather than spreading evenly, which is the entire reason a dune has a gentle sunlit windward face and a steep shadowed lee face instead of being symmetric, and it is also what makes the pattern self-reinforcing — a bump that is slightly taller casts a slightly bigger shadow, catches slightly more sand, and grows slightly taller still.

Two patterns, two different sizes

Watch long enough and you'll see structure appear at two unrelated scales from the same two rules. Small ripples, a few hops wide, form fast: they are set almost entirely by the wind reach slider, because that number is the only length scale the hopping rule knows about. The larger shapes underneath them — isolated crescents at low sand supply, merging into connected ridges as you add more sand — take far longer to settle, because they are set by how much sand there is relative to the size of the field, not by any one grain's hop. A real desert shows exactly this: wind ripples a few centimetres apart riding on the back of dunes tens of metres tall, both carved by the same wind through the same two rules, just because the lengths involved happen to be different.

The slope limit slider is the other half of the model: Werner's avalanche rule, the same angle of repose that keeps a poured sugar pile from growing into a spike. Any time a step between neighbouring cells exceeds the limit, one grain slides from the high side to the low side, checked and reapplied every frame until nothing is left standing too steep. Push the limit up and slip faces hold a sharper angle before they give way, which is also why a real dune's lee face sits close to a fixed 34°, sand's own angle of repose, almost regardless of the dune's size.

The grid wraps left-to-right, so a grain hopping off the right edge reappears on the left — a standing wind over an endless field, the same simplification Werner's own model uses. Height is capped only by how much sand exists; colour encodes height, and a brightness term from the local windward–leeward slope stands in for a one-directional sun. ?warm= runs extra steps before the first paint, so a screenshot shows an established field rather than bare ground.