I'm trying to find an example or tutorial of how to add Fluid simulation.
Do you know if it is possible to simulate Fluids using Box2D or any other 2D physics engine?
Any tutorial to have a look at?
Jump to content
Posted 05 March 2013 - 11:57 AM
Take a look at Jos Stam's Real-time Fluid Dynamics for Games: http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf
It's a very good introduction that let's you create your own single-phase, grid based fluid simulation.
I implemented it in C# with two modifications that made the algorithm more efficient: Instead of clearing the projection buffer I advect it along with the other fields, and were able to reduce the iterations for mass conservation from 20 to 5 for the same fidelity. Also, vorticity confinement adds to the fidelity while allowing you to reduce the number of relaxation iterations.
Alas, I never made a fancy OpenGL renderer for it, just GDI+.
Afaik, Box2D doesn't do this, but the Chipmunk engine might be able to emulate fluids using heaps of rigid bodies.
Edited by makeshift_hospital_bed, 05 March 2013 - 12:20 PM.