Mountains from uplift and erosion, live in the browser

Push a block of land up out of the sea and watch rivers carve it into ridges and valleys. A landscape evolution model, millions of years a minute, that you can paint on.

Published
19 November 2026
Run
In the browser
Model
Stream-power incision, uplift and soil creep
Stack
Rust, webassembly, webgl
Download
60 KB
Open mountains
Contents
  1. Three things change the height
  2. Where the water goes
  3. Balance
  4. Painting on the land
  5. Solved implicitly, in one pass
  6. Checked against cases with known answers
  7. What it leaves out
  8. Small enough to just open
  9. Try it
  10. Further reading

A mountain range is a standoff. Plate tectonics pushes rock up, a few millimetres a year in the fastest-rising ranges, and rain and rivers wear it down. Where the pushing wins, the land rises; where the rivers catch up, it stops growing and holds its shape while rock keeps moving through it, the way a waterfall keeps its shape while the water moves through.

Geomorphologists study that standoff with landscape evolution models: a map of heights, a rule for how fast the ground rises, and a rule for how fast rivers cut. Run for millions of years, a handful of rules like that grows branching ridges and river networks that look a great deal like the real thing. The app described here, mountains, runs one live in the browser. Open it, pick a scene, and paint on the land.

Three things change the height

The model keeps one number for each point of a 128 km square, its height h, with the sea on all four sides. Three things change it:

∂h∂t=U−KAmS+D∇2h

U is uplift, the ground being pushed up. K Am S is the stream-power law for rivers cutting into rock: the more water a river carries (its drainage area A, everything upstream of it) and the steeper it runs (its slope S), the faster it cuts down. K sets how easily the rock erodes. The last term is soil creep, the slow slide of soil downhill that rounds off ridge tops; on a grid of 500 m points it matters much less than the rivers.

Where the water goes

Rain falls everywhere and runs downhill. Each point sends its water to whichever of its eight neighbours is steepest downhill, and adding the water up from the ridges to the sea gives every point its drainage area. The points with the most are drawn as rivers. A hollow with no way out fills into a lake until it spills over its lowest rim, found with the priority-flood method; rivers cross the lake and carry on from its outlet.

Balance

Under steady uplift the land rises until the rivers cut down as fast as it goes up, and then it stops changing shape. In that state the equation gives the slope of every river directly: S = (U/K) A−m. Small streams near the ridges are steep, big rivers near the sea are gentle, which is the concave profile of real rivers. A rising block gets there in a few million years.

That one relation explains most of what the app shows. Faster uplift needs steeper rivers to keep up, so the mountains stand higher. Harder rock, a smaller K, does the same, which is why a band of hard rock painted across a range ends up as a ridge long after the softer rock around it has been worn down. Stop the uplift and nothing holds the range up: it is mostly gone within a million years.

Painting on the land

The brushes change the rules under them rather than the heights directly. Make it rise sets a patch rising at the uplift rate, as where plates collide, and the rivers start cutting into it at once. Stop it rising turns that off. Hard rock makes the ground five times harder to erode. Dig a lake lowers the ground into a hollow. Each takes effect as the model runs, so the drainage can be watched reorganising: raise a ridge across a valley and the river above it is dammed into a lake, then finds a new way out.

Solved implicitly, in one pass

Stream-power models are stiff: a big river on a steep slope cuts fast, and a simple time step small enough to stay stable is far too slow to watch. The engine uses the method of Braun and Willett. Every step, the points are put in order from the sea upstream, and because a river’s cutting depends only on the height of the point it flows into, each new height can be solved exactly from the one downstream of it, in a single pass. That makes the step unconditionally stable, so each one covers ten thousand years.

Checked against cases with known answers

The engine is tested against what the equation says on paper. Under steady uplift the rivers must settle onto the slope–area law above, and they do to within 2 per cent. Every point’s water must reach the sea, with no water lost or made on the way. Hard rock must end up standing higher than soft rock under the same uplift, and soil creep must round off a bump without changing its volume.

What it leaves out

Rivers here carry away everything they cut; nothing settles out to build plains or fill lakes, which later work on the same solver adds. There is no flexure, so the crust does not bob up as weight is worn off it, no glaciers, and no difference between wet and dry sides of a range. Those are the next layers a research model would add; the core balance of uplift against river incision is already enough to grow a convincing range.

Small enough to just open

The engine is about 260 lines of Rust compiled to WebAssembly, and the whole app is about 60 KB. There is no server, and the 3D view is plain WebGL, lit from one side and coloured by height and slope, white on the highest ground and the rivers drawn in blue.

Try it

Open mountains in a browser. It starts on a rising block; the scenes include a single range and a band of hard rock, or a low plain to build your own. On a phone, drag one finger to paint and two to turn and zoom.

Further reading