A procedural terrain generator with hydraulic erosion written in C++ and OpenGL compute shaders.
While running, press Left Alt to toggle between camera and cursor input.
There are two modes of hydraulic erosion available:
- Grid based erosion (shallow water model based on virtual pipes)
- Particle based erosion (raindrop simulation)
By default hydro-gen uses shallow water model for simulation.
In order to change the model, change the erosion type in the config.ini.
You can also change the default particle count used by the program.
This will enable particle based erosion and change the settings accordingly.
Erosion parameters include:
- Total transport capacity of a particle / unit of water
- Speed of dissolution
- Speed of deposition
- Water evaporation speed
- Talus angle of the material
- Slippage erosion speed
After changing the in-game parameters, press the "Set Erosion Settings" button to sent the updated parameters to erosion shaders.
In order to run the program a GPU with the OpenGL 4.6 support is required.
- C++23
- CMake
- Ninja
- vcpkg with the
$VCPKG_ROOTenvironment variable set
Same as above or:
- Microsoft Visual Studio with MSVC, Ninja and CMake modules
If you don't want to use vcpkg then following libraries are required:
OpenGL
fmt
GLEW
glm
glfw3
Imgui
The building scripts use Ninja by default, you can change this manually in CMakePresets.json
git clone https://github.com/ger0/hydro-gen
cd hydro-gen
cmake --preset debug
cd build
ninja all
./hydro-gen
In order to change dimensions of the window: change the width, and height values in te [window]
key in the config.ini.
The default map size can be changed by replacing the size value in the [map] key in the config.ini.






