During the Computer Graphics course students of the CMC Faculty of Lomonosov MSU are offered to solve a task on water simulation algorithm and create a scene using the algorithm.
Obligatory requiremnts are as following:
- using at least 3 different objects (pool walls and bottom are 2 different objects);
- using at least 1 light source;
- realistic lighting;
- water should be transparent;
- controlling with keys.
Students are also offered to perform additional features.
I implemented more complex version of the task using OpenGL3, shaders (besides basic vertex and fragment shaders I also use geometric shader) and calculations on a GPU.
Controlling:
- WASD - camera moving;
- mouse - camera turns (as in shooter games);
- SPACE - add extra (random) perturbations;
- Q - start/stop wireframe visualization;
- F5 - start/stop the simulation;
- ESC - close window.
Extra features implemented on the scene:
- Using textures (pool tiles);
- advanced camera controlling;
- interactivity (you may add perturbations using SPACE key);
Solution to the task is written on C++: main.cpp.
Requirements:
you need to have OpenGL3, glfw3, glew, X11, SOIL, glm libraries installed.
To install them do:
$ sudo apt update
$ sudo apt install libglfw3-dev
$ sudo apt install libglew-dev
$ sudo apt install libglm-dev
$ sudo apt install libx11-dev
$ sudo apt install libsoil-dev
For more information about libraries used: CMakeLists.txt.
To compile the program do:
$ cmake .
$ make -j 4
To run the program do:
$ ./WaterSim