This is my final project for the Animation for Computer Games course, which was offered by Prof. Tiberiu Popa at Concordia University. The topic of my project is implementing Smooth Particle Hydrodynamics (SPH) using n-body simulation. I have implemented the governing equations described in this paper. Everything is GPU-driven and happens in the compute passes. I have used The Forge rendering middleware for running my vertex, fragment, and compute shaders on Vulkan and Directx12 APIs. Finally, I thank the author of this excellent blog post for explaining the GPU implementation details, such as dynamic hash grid and GPU sorting. You can check out the source code for more details.
Features
Spawns particles on a sphere surface. The sphere position and radius can be controlled.
All parameters, from particle count to equation constants, are modifiable via the UI in runtime.
The particles are rendered as spheres using instance drawing.
The camera can move around the scene.
The simulation can be paused or slowed down while the camera can still be moved.
The particles collide with different elements of the scene.
There is a push force at the mouse cursor, and its range and power can be adjusted.
The following videos will showcase some of these features.
The ability to take a screenshot or capture all the frames to playback.