Return

DFSPH Fluid Simulation

Role: Solo Developer

Stack: C++, Vulkan, Compute Shaders

Duration: 2025 – 2026

A particle-based fluid simulation running in real time implemented in Vulkan and C++ following the Divergence-Free Smoothed Particle Hydrodynamics (DFSPH) paper.

The goal was to create a demo for a small fluid simulation and research various methods and alternatives. The development of this project has been one of the hardest things I have done. At the beginning I was researching multiple type of fluid simulations both particle based and grid based. After deciding which path I wanted to take I created a small prototype using SPH and after trying PCISPH I went with the DFSPH method. The math and physics involved were the hardest part to implement as I lacked experience reading white papers and advance math at the time. After making the simulation work I started going for optimization including a Neighbourhood search, caching and later converting all to compute shaders.

Personally I believe this is an incomplete project as there are so much things I wanted to add. I wanted to convert the simulation to 3D but due to time I couldn't make it work properly. I wanted to try some rendering techniques for the water like Screen Space or Raymarching. A more advanced physical simulation with vorticity solver, custom mesh collision and maybe PDB. Finally I wanted to try a Regression Forest optimization approach as this is one of the reasons I wanted to do Particle based instead of grid based simulation in the first place.

But I will return.

Highlights

  • Simulation built from scratch following the DFSPH paper algorithm.
  • Solver stages optimized with compute shaders for real-time particle counts.
  • Ported a smaller version to a native Vulkan Android application.

Tools

  • Vulkan
  • Git

Languages

  • C++
Next
Voxel Space Terrain Renderer →