The first type of erosion I will be using in my model is the simulation of matter becoming loose and falling under gravity, this is known as thermal erosion.
The program loops through every point on the heightmap checking the difference between the height of it and of its neighbors. When this value is above a value defined by the user (the talus value) height is moved from the higher square to the lower to make them teven. If multiple lower squares exist, height is distributed according to:
Where ‘hi’ is the current point, ‘dmax’ is the largest height difference between all neighbors, ‘di’ is the current neighbor, ‘dtotal’ is the sum of all the differences in height between this point and its neighbors. ‘c’ is a value that stops strange oscillation artifacts effecting the program and ‘T’ is the talus value.
Neighbours are defined as either being all the points around any point (left, Moore Neighborhoods) or the points in each cardinal direction from any point (right, Von Neuman Neighborhoods). Using Von Neuman is twice as fast, and produces just as convincing erosion effects.
The top terrain is eroded into the lower using this method.