Hydraulic erosion is a dominant force in shaping most landscapes on
Earth. The basic process runs as follows:
Rain falls from the sky, putting water on the ground
Water flows down hill
Water can store and transport sediment
Faster water can store more than slower water
Faster water erodes more, removing material from the ground
Water both evaporates and is absorbed by the ground
Within these general guidelines there are many additional factors to
consider. Water has momentum and interacts with other water; water
dynamics change with temperature and amount of carried sediment; the
ground is made of many types of material, some more easily eroded than
others; drying out can change the material properties of the ground; and
so on.
Simple hydraulic erosion works as follows:
An initial non-eroded terrain is created, either by a fractal
method like faulting planes or by an
artist-supplied base mesh.
A few thousand iterations of water moving across the terrain are
simulated. There are two broad ways to do this:
Water is modeled as a grid of water heights and other properties.
Basic laws of water flow are used to update this grid. A few thousand
iterations are needed to get reasonable erosion effects, each of which
processes the entire grid.
Water is modeled as a sequence of individual particles. Particles
are distributed based on rainfall models and roll down hill. Hundreds of
thousand of iterations are needed to get reasonable erosion effects,
each of which processes the path of just one particle.
This page explores a simple version of each of these methods.
Let each vertex have an altitude a, water volume w, and suspended sediment s.
The top of the water at a vertex is thus at height w+a; that’s important because the difference
in top-of-water heights is what decides which way water flows (and how
quickly).
Move water and sediment between adjacent vertices i and j
using Δw=min(wi,(wi+ai)−(wj+aj))
If Δw≤0, increase
ai and decrease si by Kdsi, where Kd is a deposition
rate constant you pick
Otherwise,
move Δw from wi to wj
let c=KcΔw, where Kc is a sediment carrying capacity constant
you pick
If si>c
add c to sj
add Kd(si−c) to ai
set si to (1−Kd)(si−c)
otherwise
add si+Ks(c−si) to sj, where Ks is a soil softness constant you pick
subtract Ks(c−si) from ai
set si to 0
In the original paper this algorithm was said to apply to each
neighboring vertex with this caveat:
In a full two-dimensional implementation, one must take care to
distribute water and sediment to all neighboring lower vertices in
amounts proportional to their respective differences in overall
elevation.
This not only requires some care to pick the distributions, but also
requires care so that the order in which you compute the motion from
cell i to j vs the motion from cell j to k does
not change the results.
Various realizations of this distribution criteria has been used; one
of the simplest is a two-pass system
In the first pass, find how water and sediment should move:
Pick Δw for each pair of
cells such that the total Δw out
of cell i is at most wi and is distributed between all neighbors
with aj+wj<ai+wi
proportionally to how different those are
Accumulate the corresponding changes to w, a, and
s but do not apply them yet
In the second pass, apply the changes to w, a, and
s
Parameters in this method:
how much w to add initially
(rainfall amounts)
how often to have more w added
(rainfall frequency)
whether to have w reduce a bit each
step (evaporation) or not, and if so by how much
Kd, Kc, and Ks
controlling erosion rates
2 Particle-based approach
The first particle-based erosion technique was published by Chiba,
Muraoka, and Jujita in 1999. That paper described a fairly involved
algorithm, including a model of the under-cutting effects of turning
rivers, though their simulations did not show that complexity’s
impact.
A simpler version works as follows:
Pick a random point and drop a particle there with
Zero velocity v
Some initial water volume w (i.e. a
positive starting value you pick)
No sediment s
While the particle retains volume,
Accelerate the particle by adding Ka times the non-vertical component of the
surface normal to its velocity
Ka is an acceleration constant you
pick
you’ll need to dynamically compute the normal based on the
ever-changing heights (and normalized it after computation)
Slow the particle by multiplying its velocity by (1−Kf)
Kf is a friction constant you
pick
Move the particle by adding its velocity to its position
if it goes off the map, stop working with this particle
Compare the sediment it is carrying (s) to the sediment it could carry (Kc∥v∥w)
Kc is a sediment carrying constant
you pick
if it has more sediment than it should, move Kd of the difference from s to the altitude of the terrain particle
0≤Kd≤1 is a deposition
constant you pick
if it has less sediment than it should, move Ks of the difference from the altitude of
the terrain to s
0≤Ks≤1 is an soil softness
constant you pick
reduce w by some small fixed
evaporation rate you pick
if w≤0, stop working with this
particle
Repeat the above several hundred thousand times
The above has a particle moving in analog steps across a discrete
grid. While it is somewhat more accurate to interpolate particle
positions onto the nearby terrain vertices, it is generally adequate to
simply round to the nearest vertex instead when finding normals and
lifting and depositing sediment.
Parameters in this method:
initial w per particle and
evaporation rate (together giving a lifetime of the particle)