Up to 1 million 3D particles being simulated in real-time using a SPH ( smooth particle hydrodynamics ) using DirectX 11 computer shaders on a NVidia GTX 780 TI.
This demo was based on the FluidCS11 sample by Microsoft which was based on some work from Matthias Müller and Scott Le Grand. I overhauled it for the following reasons.
This simulation enforces a minimum of 180 steps per second and a maximum of 300 steps per second. Anything under 180 steps will make the simulation unstable, and anything over 300 is overkill and waste GPU cycles. The render rate is set to 90 frames / second and is throttled independantly from the simulation speed.
If you set the simulation to use 512k particles, a GTX 780 TI will be able to render the final particles at 90 fps, but will only be able to simulate them at rougly 50% of the target simulation rate. If this happens, it will simply appear that time has slowed down and the water will continute to simulate properly. Check the "Simulation Speed ( Actual )" to see if it is running at full speed.
This simulation uses an orthogonal view, but the SPH algorithms are in fact running in 3D using a dynamic grid cell approach for sorting and spacial search. It divides the grid based on where the action is. The dimensions of the box is 4x2x1 ( width, height, depth ) and if you use 512k or 1024k particles they splatter at first because they initialize outside the walls and get blown inward with massive force ( need to fix that ). If the wall restraints are disabled, the water can flow whereever. The simulation uses 20+ compute passes for grid-based particle sorting and another 10+ passes for the simulation and rendering.
Click for videos ( and eventually a download ) of version 2 of SuperFluids which exposes a bunch of options, mutli material support, more parameters to mimic a wide range of materials like milk, blood, syrup, goo, snow, sand, cotton, foam, whip cream etc.