Smoothed Particle Hydrodynamics (SPH) Simulation - Recreating Spelunky 2 Lava in Unity

Опубликовано: 11 Сентябрь 2026
на канале: Davide Nuzzi
559
2

Smoothed Particle Hydrodynamics simulation created using Compute Shaders in Unity. It supports tens of thousands of particles at more than 60fps on an Nvidia GTX 1050.
Particle hashing is employed in order to have an infinite simulation domain and the wall collisions are all resolved by the GPU.
The particles are rendered as metaballs in another Compute Shader and colored by the local fluid density. The background image under the lava is blurred using a gaussian blur filter.