Skip to content
Flashy 2D fluid simulations experiments.
Branch: master
Clone or download
Erkaman Update
add path to source code.
Latest commit c905b9f Apr 28, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
deps repo clean up Apr 28, 2018
gifs add readme. add gifs. add license Apr 28, 2018
src fix indentation in shader code Apr 28, 2018
.gitignore repo clean up Apr 28, 2018
CMakeLists.txt repo clean up Apr 28, 2018
LICENSE add readme. add gifs. add license Apr 28, 2018 Update Apr 28, 2018
smallmona.jpg add mona lisa fluid sim Apr 25, 2018
smallscream.jpg refactor png loading code. Apr 25, 2018

fluid_sim - Some flashy 2D fluid simulations

Animated Animated Animated Animated

An implementation of the article "Fast Fluid Dynamics Simulation on the GPU", using C++ and OpenGL 3.3. This implementation implements the "advection", and "projection" steps from the article. The "diffusion" and "boundary conditions" steps of the article are not implemented. Finally, note that the primary focus was on making flashy simulations, and not on physical realism.

The code is minimalistic and is written in only ~1000LOC of C++, and uses only OpenGL and no frameworks whatsoever, so the code should be readable. The source code can be found in src/main.cpp


Longer video of fluid simulations:



The only dependencies are GLFW and stb_image. Both of which are included within this repository.

We use CMake for building. If on Linux or OS X, you can build it in the terminal by doing something like:

mkdir build && cd build && cmake .. && make

If on Windows, create a build/ folder, and run cmake .. from inside that folder. This will create a visual studio solution(if you have visual studio). Launch that solution, and then simply compile the project named fluid_sim.

You can’t perform that action at this time.