Log inGet started
Package

terrain_erode_stream.computeShader

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

terrain_erode_stream

Stream-power erosion on a grid of at most a few hundred cells a side, the step terrain.erode runs for model = "stream".

One dispatch is one step, picked by the MODE specialization, and each step writes one cell per thread from the buffers of the step before, so a run gives the same ground every time.

MODEOne thread perWrites
downwork cellthe mean of the field cells it covers
sumwork cellthe sum of the weights of its drops to its neighbours, the edge draining outward
areawork cellone Jacobi pass of the drainage area in cells: one plus what each higher neighbour sends it, each neighbour sharing its area among its lower neighbours by drop ^ power
incisework cellthe height after the implicit step (h + F * h_r) / (1 + F) toward the steepest lower neighbour, F = K * A^m * dt / run, plus the uplift step; K varies by variation over variationSize metres by the seed; with keep 1 the step lowers a cell and never raises it
relaxwork cellthe height after the talus limit (rest, rate) and creep between the four neighbours; with keep 1 the limit is the steeper of rest and the slope the two cells had when the run began, and creep evens out only the change
upheld cell of the fieldthe work grid read bilinearly, src * scale - subtract * aux

The step never lowers a cell past the neighbour it drains to, so a long run settles instead of running away. A depression with no lower neighbour keeps its water: its area stays in it and nothing cuts it.

With keep 1 the run keeps the shape it started from wherever the cutting does not reach: a closed basin holds its depth, since the filled surface steers the drainage across it without raising its floor, and a face steeper than the talus limit stands.