A couple of engineers at graphics card developer Nvidia have released a pair of videos to showcase the power of the PhysX engine, which is now being used to provide convincing water effects that react to other objects and the environment completely in real time, all running on a single high-end GTX 580—which isn't the best of cards they have to offer.
Nvidia calls it a "fluid simulation technique via the utilization of a Position Based Dynamics approach," parts of which have been used to simulate the liquid feces that spurts out of outhouses in Borderlands 2.
The videos were released in a new paper titled "Position Based Fluids" by Miles Macklin and Matthias Muller-Fischer of Nvidia, who gives proper insight into how the algorithm works.
"In fluid simulation, enforcing incompressibility is crucial for realism; it is also computationally expensive. Recent work has improved efficiency, but still requires time-steps that are impractical for real-time applications.
In this work we present an iterative density solver integrated into the Position Based Dynamics framework (PBD). By formulating and solving a set of positional constraints that enforce constant density, our method allows similar incompressibility and convergence to modern smoothed particle hydrodynamic (SPH) solvers, but inherits the stability of the geometric, position based dynamics method, allowing large time steps suitable for real-time applications.
We incorporate an artificial pressure term that improves particle distribution, creates surface tension, and lowers the neighborhood requirements of traditional SPH. Finally, we address the issue of energy loss by applying vorticity confinement as a velocity post process."
Full credit goes to PhysXInfo.com for the embedded videos.