HDS is a hydrodynamic simulator that reproduces water behaviuor in different contests and landscape (parsed dynamically from a .hds file). At the moment rain, flood, drainage, waves and tsunami scenarios are implemented. It's built with C++ and OpenGL 4.0.
OpenGL 3.3 or greater is required. It is currently set up to use
OpenGL 4.1, but you can change it to match your hardware's specifics by editing the following lines:
# define GL_MAJOR 4 # define GL_MINOR 1
This programm was tested solely on
OSX machines, but should be compatible with
UNIX operating systems. You can always drop me a line for support, but keep in mind that it was not designed with cross-platform compatiblity as a requirement.
Depending on your graphical hardware, you might experience slowdowns when using the
rain scenario. Decrease or increase the numbers of instances editing this line:
# define MAX_INSTANCES 17000
Recent graphical hardwares can handle up to millions of instances.
During the simulation you can press the following keys:
arrow keys: change the angle of the camera
+: zoom in
- zoom out
d: start draining the water out of the scene
f: restart the simulation as a flood scenario
w: trigger gentle waves scenario
Run Hydrodynamic Simulator
./hds <scenario> <maps>
Both parameters are required, otherwise an exception will be thrown.
flood: Water flood the scene from all four borders.
waves: Gentle waves come from one border of the scene and progressively covers the terrain.
rain: Strong precipitations.
drain: Drainage from all four borders.
tsunami: A giant wave crashes the scene.
Specify a path to a map file.
#Create map file
Map file should end with .hds extension and should have the following format:
x:<0:col> y:<0:> z:<0:row>
You can add as many height points as you like (y coordinate represent the height). Feel free to create your own map and to share it on this github repository.
Contains header files related to libraries (GL, GLM, GLFW) and source files.
Contains GLEW and GLFW3 static libraries.
Contains the C++ source code.
Contains a set of maps used by the program.