This is an implementation an erosion simulation in Unity based on the papers Fast Hydraulic Erosion Simulation and Visualization on GPU and Interactive Terrain Modeling Using Hydraulic Erosion.
The simulation uses multiple compute shaders that compute the flow of water, sediment transport and decomposition and water evaporation.
The goal of this project was to get familiar with compute shaders in Unity and create beautiful pictures.
- Create a plane mesh with lots of subdivisions and import it into Unity (I just used Blender).
- Add an ErodingTerrain component.
- Add the VertexDisplacement material to its Mesh Renderer.
- Use the editor script to create a base terrain.
- Uncheck the 'EditTerrain' flag to run the simulation.
- Change the parameters to your liking.
- Check the 'EditTerrain' flag to edit the base terrain again.
- Rinse and repeat.