Implicit Surface Fluid Rendering

This is a demonstration of an effect for rendering fluids with implicit surfaces, written in C++ and OpenGL. It works by first simulating particles on the CPU:

Particles

Then it renders a quad for each particle on the GPU:

Quads

And finally it traces a ray in the quad’s pixel shader against the implicit surface formed by the distance field formed by the set of particles:

Quads

Each particle on its own defines a spherical distance field where the implicit surface is defined as being at distance X from the surface. This results in small spheres that can look like droplets. By combining the distance fields of multiple particles, a more natural result can be achieved because the implicit surface now deforms according to the influences of multiple particles (see the image at the start of this post).

See https://github.com/DoerriesT/Implicit-Surface-Fluid-Rendering for more details.