views:

1128

answers:

4

For a while I've been attempting to simulate flowing water with algorithms I've scavenged from "Real-Time Fluid Dynamics for Games". The trouble is I don't seem to get out water-like behavior with those algorithms.

Myself I guess I'm doing something wrong and that those algorithms aren't all suitable for water-like fluids.

What am I doing wrong with these algorithms? Are these algorithms correct at all?

I have the associated project in bitbucket repository. (requires gletools and newest pyglet to run)

+1  A: 

What type of water are you trying to simulate? Pools of water that ripple, or flowing liquids?

I don't think I've ever seen flowing water ever, except in rendered movies. Rippling water is fairly easy to do, this site usually crops up in this type of question http://freespace.virgin.net/hugo.elias/graphics/x_water.htm

Piku
flowing liquids, rippling pools are quite trivial, even though cool and I'd know how to simulate those already. :>
Cheery
+1  A: 

Yeah, this type of voxel based solution only really work if your liquid is confined to very discrete and static boundaries.

For simulating flowing liquid, do some investigation into particles. Quite alot of progress has been made recently accelerating them on the GPU, and you can get some stunning results.

Take a look at, http://nzone.com/object/nzone_cascades_home.html as a great example of what can be achieved.

Ali Parr
+2  A: 

Voxel-based solutions are fine for simulating liquids, and are frequently used in film. Ron Fedkiw's website gives some academic examples - all of the ones there are based on a grid. That code underpins many of the simulations used by Pixar and ILM.

A good source is also Robert Bridson's Fluid Simulation course notes from SIGGRAPH, and he has a book "Fluid Simulation for Computer Graphics" that goes through developing a liquid simulator in detail.

The most specific answer I can give to your question is that Stam's real-time fluids for games is focused on smoke, ie. where there isn't a boundary between the fluid (water), and an external air region. Basically smoke and liquids use the same underlying mechanism, but for liquid you also need to track the position of the liquid surface, and apply appropriate boundary conditions on the surface.

batty
A: 
Jacob Stanley