Hi there,
Been working on an SPH ( smooth particle hydrodynamics ) water simulation to test out a simulation throttling system for my shader development tool ( ShaderFlex ) and I got a little carried away with the water. Here's a link to the video for version 2. You can download version 1 now to play around with, but it doesn't look nearly as cool as version 2 which I plan on posting soon.
http://www.shaderplay.com/sandbox/superfluids2/superfluids2.html
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. The rendering and simulation are independent from one another and it can render at full speed but I lock it to a fixed frame rate so the simulation shaders have more horsepower. 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.
http://www.youtube.com/channel/UCEljvElA7sJqMr_wy4Agdcw
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
- stickiness
- blobiness
- dilutio
- shadows
- weight
- antigravity
- near/far color
- alpha
- particle texture
- pressure stiffness
- rest density
- viscosity
- mixability
- particle size
- sim and render speeds
- foam options
- input controls
- simulation steps
- wall collider options, etc.
- back to front sorting with alpha
- lighting controls ( possibly two lights )
I'd would put in some cool streaking bloom, ssao and dof effects but I probably won't have time.
Let me know if you have any questions and check back at my site for version 2 soon or add your email to my newsletter and I'll send you a link to the download when it's ready.