NVIDIA Cataclysm Realtime Liquid Solver

I had an e-mail with a couple questions I want to post the answers to here, because it may help others while we wait for me to release the other maps. I rephrased the questions, and removed any names, but the gist is this:

To answer your question, there are two types of liquid domain generation, which is the basis for the rendered liquid surface:

  1. If Surface at Density is Positive, Cataclysm extracts a levelset at the value Surface at Density from a smooth density field created from particle splatting, where each particle has a radius of Smooth Kernel Radius (in units of Voxel Width, so the default radius of 2 would splat up to 4 voxels wide, you can see the kernel used in FluidDensityToGrid.usf). Shrinking the Smooth Kernel Radius to 1.5 may help, but will give you less liquid volume, and I have noticed some different results with Use Density Velocity Stretch on, which will make velocity anisotropy on during the density splat… the differences are subtle and for me not worth the increased work. Your millage may vary.

  2. If Surface at Density is <= 0, Cataclysm extracts a levelset from sphere splatting with radius Particle Radius (also in voxel units). This can be a more complex surface, and for liquid domain, there may be too much surface noise for a nice solution so Cataclysm uses abs(Surface at Density) to cull out particles with a density below that. The noise problem will look like loose particle floating on the surface and causing cottage cheese looking floaties (technical language, I love it).

Those two techniques are only for generating the liquid domain. Which controls how the simulation moves, and is the start levelset for the rendered liquid surface. If you want to get rid of that simulation surface before you create the rendered liquid surface for display, you can set the Surface Offset to a high number which will basically delete the entire liquid domain and build the rendering surface from scratch, instead of union-ing it with the liquid domain first. After starting with the offset liquid domain, the rendered liquid surface is always built with the sphere levelset splatting technique with a radius of Particle Radius x Radius Multiplier. Since LS_MULTIPLIER defaults to 2, Cataclysm is actually rendering at twice the surface resolution from the simulation, which gives you a detailed surface even with smaller radius multiplier (too small and particles may pass between voxels instead of rasterize too them). But if you always start with a smooth liquid domain, and don’t offset it, then all the extra detailed may be buried inside the start surface and never seen.

Anyway, getting a detailed surface is difficult and we never settled on the perfect solution. You could run the simulation, skip building the high resolution levelset for rendering, and render the particles in an entirely new way.

To get diffuse particle foam, like the ones used in the city, you have to have the Enable Diffuse Particles box checked. That’s an entirely different simulation for visuals only and won’t affect the liquid flow. You can see how that is done in FluidDiffuseParticles.usf. I’ll include the settings we use for the city scene for you, but since those are all far away camera, I’m not sure they will give you what you need. It may take time and tweaking to get good settings, and maybe even some code changes to get good looking foam.