Note: I have recently discovered that the implementation of this algorithm is not numerically stable, and will in some cases destroy the height field it is operating on. Be advised that this is currently being worked on. Hopefully it will be resolved soon. See the develop
branch for the latest work.
This is a single-header, multithreaded C++ library for simulating the effect of hydraulic erosion on height maps. The algorithm is based on the the one in this paper.
The library takes an arbitrary terrain model and simulated the flow of water across it. As water flows, soil is picked up from the terrain and deposited in other areas depending on the flow of water.
For example, given the following model of a hill:
When the library simulates erosion, the soil transporation causes the model to change into this:
It can also smooth out noisy terrains, such as this one:
The result:
See the example to learn how to integrate the library in an application.