Sign in to follow this  

Free flowing fluids?

This topic is 4451 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone have an idea of how realistically 'doable' this is? Basically I'd need to make a free flowing fluid that can interact with a world, i.e. collisions and stuff. Here's what I was thinking about. If anyone thinks back to Pipe Dream, I was thinking about how a full 3D version would be made. I'm not talking about something like this, but rather a full 3D version of that game. Now back to the question, ideally There would be let's say a large water tower that holds the water. When the game starts, the water starts leaking out the bottom into the pipes. The problem would then be how to make a fluid that would behave as if it were going though the pipes and such. To explain a little further to make sure it's clear what I'm thinking about, imagine if you had a ride at a waterpark. When the water starts at the top, it just follows down the entire course. (Let's ignore pressure and gravity considerations, just the liquid follows any path) Not knowing about graphic and stuff, I don't even know if that would be a valid approach to this problem, so that's why I'm asking. Any ideas/comments? FYI this is just a thought I have had. I have no immediate plans to implement this nor test it out. I have too much other stuff on my hands right now, but nonetheless I was curious about this [smile]

Share this post


Link to post
Share on other sites
You could try to just create a particle system.
Add physics (forces/weights).
Add interparticle collisions ( maybe through an octree to limit the number
of collisions you have to check )
Add collisions with your pipes.
The physics/collisions should allow particles to push eachother down the pipe.
(with a tight enough octree this would probably qualify as a voxel approach.
and each particle would only have to take on descrete locations, limiting the
collisons to each face instead of distances.)

Or you could use a fluid flow (Navier-Strokes [sp?]) on a 3d grid...
but you would have to use a small grid or end up waiting forever for each
frame to go by.


Share this post


Link to post
Share on other sites
Quote:
Original post by KulSeran
You could try to just create a particle system.


That's a very interesting idea! Now that I think about it, I think that approach could very well work as a very efficient solution. I'll have to take a look into particle system design to see how to make particles act more cohesive rather than as 'particles'.

Quote:
Original post by njpaul
Link


Thanks for that! Looks like a great read, I'll have to definitly go over that. Those images in Figure 8 of the solver in action look very nice.

Well I have a basic idea of a few approaches to this problem. I'll have to keep a few mental notes if I ever come back to this issue. If anyone else has something to share, please do!

Share this post


Link to post
Share on other sites
You might want to read up on particle based cloth simulation. Typically, particles are connected by springs, which provides a fluid design. Baraff and Witkin did some of the original work on this.

Share this post


Link to post
Share on other sites
The thumbnails seem to have disappeared, but the movie clips themselves still seem to be available from Meqon AB's future technology page. Just to let you know that it is probably fairly 'doable' ;-)
Obviously Meqon is at the forefront of this stuff, but I imagine similar options may be available for Free libraries like ODE in the not too distant future (of course, if you want to write an ODE extension for this and release it, I'm sure no one would object :-P)

-bodisiw

Share this post


Link to post
Share on other sites
The Sh toolkit has some water examples in this article.

edit: I was wondering as I was reading this thread if these algorithms/methods could perhaps be used to make some realistic shoreline rendering -- waves breaking, etc. All games I've seen to date have a flat shoreline with a "foam" texture that moves around or something similar. Highly unrealistic. That's sorta been my holy grail rendering technique. :)

Share this post


Link to post
Share on other sites
Awesome! Thanks everyone for the additional information. Right now I am thinking about some more 'original ideas' based on something with the aspect of this 'free flowingness'. This weekend, I'll revisit this thread and read some more into everything. Right now I was thinking about something with electricity and protons/electrons [smile]. So much to do, so little time... Thanks again guys!

Share this post


Link to post
Share on other sites
Personally, I'm not convinced that solutions based on velocity fields are ever going to be a general solution to water in game engines - Jos Stam's paper notes at the end that you've got to extract the boundary between water and air in order to render the water surface, and also, your water is constrained to the volume covered by the velocity field. That could need to be a pretty large volume...

I've reckoned for a while that it's possible to break a generalised water system down into subvolumes (probably convex ones) and then establish statistical averages for water in/out at each face of the volume, or pressure or something; by connecting volumes together you can run water through pipes, tanks, channels, and by differentiating between watervol/geometry boundaries and watervol/air boundaries you can pretty quickly establish the faces where you need to render the water surface. The difficult part is probably the 'realtime CSG' required to compute convex volumes... especially if you're looking at being able to drop objects into a volume (causing it to fracture into smaller volumes).

I've not tried any of that though, only thought about it. (If anyone knows of any work done with that kind of method I'd be interested).

Share this post


Link to post
Share on other sites
Well, I'm currently studying real-time smoke simulation for my Honours in B. Comp. Sci. (Computer Games) and have reviewed a bunch of papers concerning fluid simulation. I reckon there's a few different direction you could go in trying to model this water flow idea.
KulSeran's idea of utilising particle systems is a good one, especially for such a situation as the water almost always being in pipes. If you let each particle represent a 'packet' or small moving volume of fluid, with density, pressure, velocity and vorticity this method becomes known as a Langrangian fluid model -> a fluid is composed of many small volumes of fluid with particular characteristics.

On the other hand, Stam's system as linked by njpaul keeps track of the change of fluid flow past specified static points. This is called a Eulerian fluid model, and there are a lot of papers that use this model to solve the Navier-Stokes equations and get some attractive fluid animation. In particular, check out this paper on implementing them real-time on the GPU -> http://wwwcg.in.tum.de/Research/data/Publications/eg05.pdf

For world interactions, the Eulerian models are generally agreed to be better suited to handling boundary conditions. Both models have their strengths and weaknesses and there is a plethora of papers out there implementing them.
I'd say your idea is very much 'doable'.

[Edited by - PAiNIC on September 11, 2005 7:12:34 PM]

Share this post


Link to post
Share on other sites
Found a paper on 'Real-time fluid dynamics in games'. It's quite good.

http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf

There's also a website in the paper where you can go to download the code used in the paper.
I know of at least two games that have used this technique:

http://www-personal.umich.edu/~dratti/fluids/index.html

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I came across this paper not a while go:
http://www.iro.umontreal.ca/labs/infographie/papers/Clavet-2005-PVFS/

I haven't had the privilege of implementing it yet but the technique described in this paper looks pretty straight-forward and as for the results... well, you can judge by yourself.

Share this post


Link to post
Share on other sites
Quote:
Original post by superpig
Personally, I'm not convinced that solutions based on velocity fields are ever going to be a general solution to water in game engines - Jos Stam's paper notes at the end that you've got to extract the boundary between water and air in order to render the water surface, and also, your water is constrained to the volume covered by the velocity field. That could need to be a pretty large volume...

I've reckoned for a while that it's possible to break a generalised water system down into subvolumes (probably convex ones) and then establish statistical averages for water in/out at each face of the volume, or pressure or something; by connecting volumes together you can run water through pipes, tanks, channels, and by differentiating between watervol/geometry boundaries and watervol/air boundaries you can pretty quickly establish the faces where you need to render the water surface. The difficult part is probably the 'realtime CSG' required to compute convex volumes... especially if you're looking at being able to drop objects into a volume (causing it to fracture into smaller volumes).

I've not tried any of that though, only thought about it. (If anyone knows of any work done with that kind of method I'd be interested).


what you are talking about is using the more general finite element method, instead of the in computational fluid machanics commonly used finite differences.

Share this post


Link to post
Share on other sites

This topic is 4451 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this