SuperFluids v2

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.

 

Did some more work on the SPH ( smooth particle hydrodynamics ) water simulation to test out a simulation throttling system for ShaderFlex. Got a little carried away but the results are better than expected given that this is only particles and hasn't been converted into a metaballs mesh or anything. More information can be found at the bottom of the page and be sure to check back in a week or so for the demo or add your email to my newsletter and I'll let you know when it's ready. It's quite addictive so if you smell your GPU burning, you might want to give it a break ;)

 

By the way, version 1 demo download can be found here ( if you want to get a small taste of the water in real-time until version 2 is posted ). The demo is based on the FluidCS11sample from microsoft which features a 2D optimized grid algorithm for GPU sorting by Scott Le Grand as well as the SPH algorithm from Matthias Müller for particle hydrodynamics.

 

 

 

 

 

 

 

As mentioned, it can simulate up to 1 million particles at roughly 25% real-world speed on a GTX 780 TI, and 256k particles at full speed. Full speed for the simulation in the video means 200 iterations per second, the simulation tries to do more, but if it can't, it will lock in at a minimum of 200 and simply run in slower motion to make sure the simulation takes small enough time steps so that it maintains its stability and doesn't blow up. The rendering and simulation are independent from one another and since the simulation is the main bottleneck, the frame rate is simply locked to a fixed rate so the simulation shaders have more horsepower to work with. The algorithm is meant for mostly non compressible fluids, but with some changes I'm able to simulate things like goo, sand, snow, cotton, milk, blood, and actually have them interact together. There's a couple of videos on my channel that show multiple materials. 

 

ShaderPlay YouTube Channel

 

It's currently all particles, but I plan on adding a marching cube meta-balls option so I can get some proper reflection/refraction and smoother look.

 

Version 1 looks 2D because it's rendered orthogonally but its algorithm is full 3D using a dynamic grid cell technique with up to 32bit worth of cells. The size ratio of the confined area is 8x4x2 ( width, height, depth ) but if the wall colliders are disabled the water can roam freely.

  

Here's some of the options that are or will be exposed

I'd like to have put in some cool HDR blooms, SSAO and DOF effects but I doubt I'll have time. Will have to wait till ShaderFlex is released to see this effect used with other stuff.