This project was developed for the Physically Based Simulation course at ETH Zürich. It simulates rainfall-driven fluid flow and erosion to model how terrain evolves over time. The simulation runs in real time and supports dynamic interaction—rainfall and water sources can be added during execution to observe their impact on the landscape.
Water flow is modeled using a simplified pipe-based shallow water approach. Each grid cell combines terrain and water height and computes directional outflows based on height differences to neighboring cells:
-
Outflow computation: $$f^L_{t+\Delta t}(x,y) = \max\left(0, f_t^L(x,y) + \Delta t \cdot A \cdot {g \cdot \Delta h^L (x,y) \over l} \right)$$
Cell model, source: [Mei et al., 2007] -
Water height update: $$\Delta V(x,y) = \Delta t \cdot \left( \sum f_{in} - \sum f_{out} \right)$$
Sediment is transported using semi-Lagrangian advection, allowing realistic erosion and deposition based on fluid velocity and terrain slope. Evaporation and sediment transport follow the techniques described in Mei et al., 2007.
The project was developed in collaboration with Adrian Blumer, Sabina Schellenberg, and myself.
- Programming Language: C++
- Technologies: GLFW, OpenGL
- Source code on GitHub
Reference: Fast Hydraulic Erosion Simulation and Visualization on GPU [Mei et al., 2007]