Making Animated Fluids Look More Realistic 124
brunascle writes "Technology Review has an article about recent advances in animated fluid dynamics made by Mathieu Desbrun, a computer science professor at Caltech. 'He and his team are developing an entirely new approach to fluid motion, based on new mathematics called discrete differential geometry, that use equations designed specifically to be solved by computers rather than people.' Desbrun explains that the currently in-use equations for animating fluid dynamics were not developed with computers in mind, and were simply reworkings of older equations. He claims that his new equations use about the same amount of computer resources, but with much better results. The article includes a 5 minute (flash) video demonstrating various results using his equations, ending with 2 fascinating and vivid displays: the first of a snowglobe, and the second of a cloud of smoke filling a volume in the shape of a bunny."
POVRay fluid simulation. (Score:4, Informative)
Re: (Score:2, Informative)
There are quite a few companies that make fluiddynamic plugins for maya or 3ds, and _those_ produce really good results.
Re: (Score:1, Funny)
Re: (Score:3, Informative)
Re: (Score:3, Informative)
All methods of fluid dynamics including the one described here use particle simulations of some kind. Even blob simulations are essentially particle simulators (mesh vertices are the particles). The difference between this method and others is that it apparently defines the flux itself based on the surface curvatures of the objects the particles are interacting with, not the conservation of momentum as per the Navier-Stokes Equations (NSE). POV may have been a bad example by the origin
Not just "a bunny" (Score:5, Informative)
Re: (Score:3, Funny)
Re: (Score:3, Funny)
However I don't think that has anything to do with animating fluids... (unless we start talking about blisters or congealing blood from REALLY bad burns).
I was hoping for a different bunny (Score:4, Interesting)
Never mind that she's over 50 now, married with 3 kids...
Re: (Score:2)
Re: (Score:2)
okay, but I'm not sure what simulating her slapping you and then suing you has to do with fluid dynamics.
Re: (Score:3, Informative)
Re: (Score:2)
Re: (Score:1, Funny)
Dammit, Slashdot (Score:4, Funny)
Re:Dammit, Slashdot (Score:4, Funny)
Re: (Score:2)
Fluids in games (Score:5, Insightful)
The article talks about breaking problems into smaller pieces, which means that it should work well with multi-core processors. Probably you'll first see "cosmetic" fluid dynamics, which don't affect gameplay, but still look pretty cool. Imagine characters splashing in water, setting off waves, creatures vaporizing into a puddle, and so on. Should be cool.
Re: (Score:2)
Re:Fluids in games (Score:5, Funny)
Oh. I'd say that more realistically rendered fluid dynamics applied to, um, certain feminine features of a certain games heroine [wikipedia.org], would greatly enhance gameplay, especially visually.
Soko
Re: (Score:3, Funny)
Re: (Score:2, Informative)
Re: (Score:3, Informative)
Re: (Score:1)
However while digging into the author of the Blender code I discovered his website. He has already developed real time methiods for interactive fluid
Re: (Score:2)
With the increasing emphasis placed on multi-core architecture, it stands to reason that the future of physical simulation belongs to cellular automata. Wolfram will be pleased.
Re:Fluids in games (Score:5, Insightful)
In a general sense, computer graphics follow a pattern where someone researches a new method, the ray tracing community adopts it into their tools, refine the technology, then some sharp thinking programmer hacks up a way to approximate the effect so it can be done in real time in a game. Bump mapping, for example, was first introduced in 1996. We didn't start seeing it heavily used in games until around 2004, and it was a combination of advancing computing power and optimization.
Not that I'm an expert, but based on this I'd guess we're at least 8 years away from having fluid simulation in whatever the FPS of the month is.
Re:Fluids in games (Score:4, Informative)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2, Interesting)
http://graphics.cs.uiuc.edu/svn/kcrane/web/projec
Re: (Score:2)
Generally speaking nowadays, the researchers use their homebrew raytracers first. Then the next group to adopt the method are the high-end scanline renderers. Then the hobbyists get it.
And it takes ages. Remember the Geforce 3 demo which showed Luxo, Jr in real-time? That's 1986-era computer graphics, finally done in real time i
try 1997 (Score:2)
My guess is that if anyone wanted to then they could have replicated Luxo Jr. in pure software around 1997, but in somewhat less than broadcast quality.
The demoscene did many effects in real time much more impressive and at higher complexity for years earlier.
Re: (Score:2)
I hung around the demoscene in 1992-4 or so (go Future Crew!), and the stuff they were doing wasn't higher complexity than Luxo, Jr. They couldn't do curved surfaces, non-Lambertian surfaces were a dream, multiple lights didn't exist and nobody really cared about character animation. My dim recollection was that things hadn't improved in those areas by 1997, though of course, they'd improved in other areas.
Re: (Score:2)
If someone had wanted to then they could have replicated luxo jr, though.
Re:Fluids in games (Score:4, Informative)
http://graphics.cs.uiuc.edu/svn/kcrane/web/projec
http://www.gametrailers.com/player.php?id=15381&t
Re: (Score:1)
I doubt this is anywhere close to realtime, he states it is about the same performance wise as current techniques, but with higher quality. The last time I tried to render volumetric smoke, it took a while.
Games use effects like dynamic bump mapping to create water effects. And yes, they are on a 2d plane but so are the current
Prince of Persia (Score:4, Insightful)
And this was in a PS2 game. We could probably be doing much better already, if people cared that much.
There was also a game called Lugaru, which was the farthest thing from "real" fluid dynamics -- yet, slash someone with a knife, and the wound would bleed a bit (leaving a trail of blood down the character's chest). Kill them with a knife, and your knife would likely drip blood, and the corpse would lie in a growing pool of its own blood. Technically less impressive -- this game can play on pretty much anything that can play Counter-Strike (the original, I'd guess) -- but all it really takes is an attention to detail.
Kind of like -- remember how we all approximated shadows? You know, you'd have a spinning fan and a fixed light source, so you'd generate a spinning-fan-shadow texture and apply it to the wall behind the fan? Eventually, of course, we got machines powerful enough and someone clever enough that we can basically just do shadows any way we want (Doom 3, Quake 4), but until that happened, there were all kinds of cheap hacks we used to make it look as good as it could at the time.
So, this is a long way from being done in games, but depending on how much attention you pay to those kinds of details, you should be able to make a game today which can look much better with respect to water -- just look at Prince of Persia.
One final thing: It won't be applied everywhere. Just look at physics -- not every game is Red Faction, and including Havok (or ODE) doesn't automatically make your game a physics sandbox. Consider that both Half-Life 2 and Doom 3 use the same physics engine. Consider that in Doom 3, you can find an invincible 3-ring binder, which you can unload your entire arsenal of unholy weapons on, burn, explode, and chainsaw it till it's pitch-black, then wait around, and the black will fade into white, and it'll be good as new.
So, you may have a little pond, or a bit of blood, which is approximated about right, but there will be exceptions -- it won't apply to the ocean, and it won't apply to every little dust particle...
Re: (Score:2)
Re: (Score:2)
Re: (Score:1)
Sorry, but you have no clue. You are speaking of ponds or oceans and there you normally don't need fluid dynamics, you need some form of wave mechanics. I just took GPU Gems 1 (from 2004) from my shelf and looked it up to make sure. Uru: Ages Beyond Myth already used a much more elaborate approach. It simulates the long waves as Gerstner waves and maps a normal map onto the resulting geometry giving the appearance of small ripples. So basically it uses a normal mapped height field, quite far from a "plane".
Re: (Score:1)
this is the real deal (Score:1, Interesting)
Sitting back. (Score:1, Funny)
Funding (Score:5, Funny)
Re: (Score:1)
Need "Before" and "After" animations (Score:5, Interesting)
Re: (Score:1)
That is totally not comparible to this simulation.
video is gone (Score:5, Informative)
More Cutting-Edge Graphics Videos (Score:5, Informative)
Re: (Score:2)
Re: (Score:2)
Yeah, I saw his work on Terminator 3, too. It looked like a real melting gynoid from the future!
Sigh.
OK, let's get serious now. Repeat after me: There is nothing "realistic" about the entertainment industry.
Some corollaries:
Re: (Score:2)
Re: (Score:1)
Real-world applications? (Score:5, Interesting)
Though the importance of properly modelling Lara Croft's swimsuit can hardly be overstated.
Re: (Score:1)
It's not clear (Score:5, Insightful)
Remember that just because a simulated fluid flow "looks" more accurate, that doesn't mean that it is. The article isn't very technical at all so it's difficult to tell what's going on here. But the way it is phrased leads me to believe that they are solving new equations rather than using new techniques to solve the well-known traditional equations (e.g., Navier-Stokes, Euler, vorticity evolution equation, etc.). The result may be that the new equations are less accurate in a point-wise sense but the resulting gross observable features of the flow may look more natural. Your eye can't tell the difference between errors O(h) and O(h^2) where h is the grid spacing, but it can certainly tell if artificial viscosity from the numerical scheme causes obvious features of the flow, such as shock waves or density discontinuities, to diffuse with time.
The applications you list require that the estimates of velocity, pressure, etc. come out accurately, and not that the resulting animated fluid flow passes the "looks plausible" test. When you're doing computational fluid dynamics solely for graphics, however, the pointwise accuracy doesn't mean squat; you want something that looks nice. I'm guessing that they've come up with a method that is optimized to make pretty movies at the expense of true numeric accuracy of the flowfield. But, again, the article is worded so generically, it's hard to tell what's going on.
GMD
Re:It's not clear (Score:4, Informative)
Re: (Score:2, Informative)
Re:It's not clear (Score:5, Informative)
In fact, just the opposite. The entertainment industry (e.g. animation/vfx) wants fluids that will obey a director rather than the laws of physics, while remaining as credible as possible.
I have read the SIGGRAPH course notes. They are indeed solving the Navier-Stokes equations. Because this is for the entertainment business, they want to retain as much visual detail as possible while keeping the time step as large as possible.
Previous approaches are based on techniques developed for astrophysics, meteorology and oceanography, where you don't care so much about the small-scale detail. To overcome this, previous approaches either modelled more viscous fluids, such as melting wax (see House of Wax for onex example) where there fine-scale detail dissipates quickly anyway, or went to some trouble to mimic the propagation of the detail. One common approach, for example, is to take the curl of the velocity field ("vorticity"), advect it, then add a bit back. Yeah, it looks pretty good.
The main advances of this approach are two-fold. One is that instead of using Lagrangian particles or an Eulerian grid, they're using a simplicial grid which matches exactly the geometry of the environment, which means that interactions with the environment are exact.
Secondly, and this is the key bit, rather than separate "a bit" of the vorticity, they treat it as a completely separate variable. The advantage is that the vorticity field, being the curl of a vector field, is inherently divergence-free. Previous techniques had to manually zero-out the divergence in a separate step, which was usually the expensive part.
OK, if you didn't understand that, think about what's happening physically. The fluids that you generally care about in visual effects/animation are incompressible at the scales that you care about. Think of a glass of water, for example. Water in a glass isn't really incompressible, but it is close enough because the "speed of sound" in water is huge, when you consider the size of a glass and the length of a single frame of film.
So the water is effectively incompressible, which means it has an effectively infinite spend of sound. That means that if you "push" it in one place, then for the water to conserve its volume/mass (volume is proportional to mass in an incompressible fluid, remember), displacement elsewhere will have to happen instantaneously. That means that in general, you can't just make decisions locally; there needs to be a step in the solver which propagates these pressure effects over the whole fluid in one step.
The advance of this new method is hard to explain, but it uses a formulation that avoids this error-prone step completely. It's not free, since it requires that you convert between vorticity and flux. And it's hard to see how you'd model some of the more difficult forces like surface tension. But it's pretty impressive nonetheless.
Re: (Score:2)
Simulating fluid flow isn't paticularly easy in some cases - the only time I've ever seen an analog computer (patch cables to amplifiers acting as integrators etc) was to do this. It was set up next to a test rig of a long pipe and the settings on the computer were constantly altered to refine the model so it would match the test rig. Also this is talking about real time simulation which is something engineers and phys
Roughly analygous to FEA? (Score:2, Interesting)
Re:Roughly analygous to FEA? (Score:5, Informative)
In fact, it's a fundamentally different approach from both of those methods. Finite element/difference means that you think of the problem as a continuous, smooth manifold. Then, you break the manifold into chunks (discretize) it, and you apply the "natural laws" like they would work on a smooth surface to the discretized approximation. The idea is that, the smaller the chunks, the errors becomes too small to notice.
However, in some cases the discretization process causes quantities (like total energy of the system) to not be conserved. The little errors add up to a lot. In fluid dynamics, non-conserved quantities cause solutions to the systems that just look wrong to the casual observer.
This team's approach is fundamentally different. Instead of discretizing a continuous problem involving a smooth manifold and continuous operators, they think of the problem as discrete to begin with and define operators on the discrete geometry. They don't say "apply the derivative to an approximation of a smooth surface", they say "apply this discrete derivative-like operator to this discrete surface". It turns out that if you define your discrete operators correctly, you can focus on conserving quantities (such as total system energy) that the normal approximation to the derivative won't.
It offers no speedup in computation time, and probably has no parallelization opportunities beyond those normally there in fluid dynamics. However, it *does* produce better-looking solutions as all of the conservation laws are met.
Very interesting research.
Re: (Score:1)
Re: (Score:1)
Re: (Score:3, Informative)
They're not the only people to do this sort of research. I remember a (Los Alamos, I think) physics research team doing a similar thing with some of Einstein's equations. By taking a different approach, they got some of the conserved quantities to stay conserved in solutions.
Not all approximations to the derivative are created equal. In fact, for smooth functions, the finite difference method is a poor
Re: (Score:3, Interesting)
To us pretty-pictures guys, a better-looking solution in the same amount of time IS a speedup, because otherwise we crank up the quality higher and slow down the calculation in order to get the results we want.
(Or fake it some other way - for example, Blizzard made a trailer for
Re: (Score:2, Informative)
It is similar. They use what is referred to as a consistent or mimetic discretization where the discrete operators have some of the same properties as the continuous operators, i.e. div curl v = 0 in the continuous case becomes DIV CURL v = 0 where DIV and CURL are the discrete version of the divergence and curl (i.e. matrices). It makes it easier to get local conservation. In this case, they focus on conserving circulation which is an
Re: (Score:1)
Can someone post links to the videos? (Score:2)
Re: (Score:3, Informative)
http://www.technologyreview.com/player/07/01/Disc
Seems to check referer, so reload once.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2, Funny)
Have you checked?
j/k
Re: (Score:2)
That's nice, but... (Score:3, Funny)
Re: (Score:3, Funny)
Interesting (Score:4, Insightful)
Re: (Score:2)
Computational Fluid Dynamics (Score:2, Redundant)
ObLink [cfd-online.com]
Paper (Score:5, Informative)
What the CFD-literate Slashdotters will want to read is the actual paper [caltech.edu] (warning, pdf) that the article is based upon.
It's a neat method, but it's nothing revolutionary. The upshot is that their method tries to conserve vorticity (fluid spin) better than the other methods currently used for graphics, with the aim of getting rid of hacks that are now necessary to Make Things Look Good. The entire spin (no pun intended) in the article about "equations for computers, not for people" is journalistic sensationalism.
All told, it's a vorticity-based Finite Element Method, which is solved as a sparse linear system. Cool pictures, though.
Re: (Score:2)
Well, if one has to describe the paper using your words or "journalistic sensationalism", I'll take the latter, thank you.
Re: (Score:3, Insightful)
Re: (Score:2)
In the Uplift universe, the mathematics of the advanced alien civilizations were based on integers. They did not have calculus, floating-point numbers, or infinities. Their mathematics were only intended for computers, which used discrete or quantized values that modeled atoms, etc., exactly.
It looks like we might be heading in that direction ourselves.
Re: (Score:2)
You're right, I made a mistake when I said that. What their model does do, is introduce (limited) numerical diffusion into the vorticity; that's a natural consequence of any explicitly
Re: (Score:1)
Larger/slower video (Score:2)
The liquefying character demo looks like it would be interesting if it could be slowed down.
Re: (Score:2)
Importance of Animated Fluids (Score:2)
Re: (Score:1)
Re: (Score:1)
Das boot (Score:2)
This + Demoscene = über (Score:1)
I would like to see them working with some of the guys from the demoscene or vice versa,
maybe they could learn some things from each other.
if they dont already, that is
Well.... (Score:3, Insightful)
The Caltech folks' approach (and this is actually the work of one of Desbrun's students, Sharif Elcott) is actually more pleasing mathematically than computationally. This particular paper makes a special effort to develop an intrinsic formulation of the equations of incompressible fluids, which allows for fluid simulation on meshes of arbitrary topology. That isn't terribly useful - movies and games aren't typically interested in 2d fluid simulation on a torus embedded in 3d...
Their approach is also closely tied to the properties of the static mesh, meaning that a lot of the "efficiency" that the method gains is the result of extensive pre-processing. If we want fluid with solid objects suspended in it, we're looking at a lot more computation.
Additionally, the vorticity method they use requires a very accurate Poisson solve to recover the velocity. Previous approaches to incompressible fluids typically solved a Poisson equation, but this was to project the solution onto a divergence-free space. In this case, it is acceptable to "cheat" a little on this part and only partially eliminate divergence. The approach in this paper doesn't allow this without serious sacrifices.
This paper deals with two models of fluid - incompressible, inviscid, Euler and incompressible Navier-Stokes. The latter is a widely accepted model for waters in reasonable conditions, but the former has no physical analogue. As a matter of fact, there are more efficient methods than this for solving so-called Poiseuille flow. They also claim great advantages over the popular "Stam advection" but their use of backward Euler integration is still going to be ridiculously diffusive, particularly when the CFL number is not obeyed.
This may seem very negative of me, but I should add that I think this is among the very best publications on CFD in graphics. This paper should have been published when it was first submitted to SIGGRAPH 2 years ago, rather than be relegated to a non-conference TOG issue. It's really too bad Sharif is not mentioned in the article, since this is his work more than anyone else's.
njord