Fluid Simulation on the GPU based on the Navier-Stokes equations for incompressible flow.
OpenGL 4.5
C++ 20 (Builds with Clang and MSVC on Windows using CMake)
vcpkg for dependencies (currently glfw + glm)
Output.mp4
Velocity, Dust/Smoke Density, Temperature
- Semi-Lagrangian (reverse) advection
- Euler or 4th order Runge-Kutte
- Optionally: Back and forth error compensation and correction
- Basic Jacobi
- Basic Red-Black Gauss-Seidel
- Multigrid Jacobi
- Only very basic restriction/interpolation schemes so far
- Full-Weighting as outlined in "A Multigrid Tutorial" is implemented on the multigrid branch, but im not yet sure if totally correct
- Only very basic restriction/interpolation schemes so far
- Brute Force Raymarcher following: https://shaderbits.com/blog/creating-volumetric-ray-marcher
- Try using Gauss-Seidel iterations as smoother for the multigrid solver
- Expose more parameters to the UI (especially Buoyancy/Gravity)
- Stagger divergence and pressure attributes on grid
- optimize everything!
- shaders currently follow forumlas closely so its easier to understand but that also means theres big room for improvement
- also test using groupshared memory for most passes since everything seems to be texture fetch bound
- ...