Terrain erosion using compute shaders in Unity

Course project at Aalborg University (2017)

We used Compute shaders in Unity to implement fast hydraulic erosion. The result was a technical prototype where one could “draw” water on a terrain in the unity editor, and interactively see mountains erode and get carried by the water. The simulation was based on shallow water fluid simulations and was well suited for parallelization. Using the GPU significantly improved it, while expressing the algorithm in HLSL as compute shaders made the code more clear and maintainable than if it had been done using the traditional graphics pipeline.

Screenshot of terrain erosion simulation

Screenshot of terrain erosion simulation