This project is the continuation of my real-time fluid experiments and brings the entire pipeline to particles.
I built a lightweight rendering engine using OpenGL 4.6 so I could control the frame-by-frame flow of data and keep the demo running smoothly on desktop hardware.
The goal was to reproduce the responsiveness of game-ready fluids while still respecting the equations behind SPH.
Everything, from neighbor search to surface reconstruction, is packed inside the engine so it can be reused for future demos.
GPU Kernels
All simulation stages are dispatched as GPU kernels: the density pass gathers contributions from nearby particles, the pressure and viscosity kernels resolve forces, and the integration kernel updates positions in parallel.
Compute shaders, SSBOs, and atomic counters let the GPU iterate over tens of thousands of particles without stalling the frame.
The CPU only orchestrates the pipeline and uploads external inputs; every heavy computation lives on the GPU, which keeps the simulation stable and real-time even under aggressive user interaction.
Results
The video below is the same one I presented during my thesis defense. It showcases different emitter setups, interactive obstacles, and rendering tweaks to highlight the particle density.
Thanks to the fully parallel GPU pipeline the demo keeps a steady frame rate, and the OpenGL renderer composites refraction, foam, and screen-space shading on top of the particle positions in real time.