Real-Time 3D Fluid Simulation

April 27, 2024 ยท View on GitHub

Major project for BCIT Computer Systems Technology Bachelor of Technology (BCIT CST BTech).

A real-time fluid simulation and rendering demo, which implements the Smoothed Particle Hydrodynamics (SPH) algorithm using OpenGL compute shaders. The rendering section utilizes screen-space techniques, including fluid rendering, real-time shadows, and real-time caustics, and incorporates mouse dragging for interactive control.

Usage

To build project with Cmake, create build folder:

mkdir build
cd build

Run CMake to generate solution files:

cmake .. -G "Visual Studio 17 2022"

Open the sln file with Visual Studio and run.

Keyboard binding:

FunctionKey
Pause[space]
Exit[esc]
Camera rotationmouse left button click
Camera displacementmouse right button click
Camera zoommouse wheel
Drag fluidmouse middle button click

Runtime screenshot

Quick simulator by python:

3D Fluid Simulator