Slashdot Mirror


Making Animated Fluids Look More Realistic

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."

20 of 124 comments (clear)

  1. POVRay fluid simulation. by suso · · Score: 3, Informative

    If you ever want to see some cool simulations of water and other particles, there are some folks in the POVRay animation usenet newsgroup (on news.povray.org) that have been experimenting around with fluids over the past year. They are actually pretty neat animations that simulate fluids pretty well.

    1. Re:POVRay fluid simulation. by imsabbel · · Score: 1, Informative

      ACtually, povray and its newsgroup is the very last place to look for good looking fluid simulation, as all those available are bad hacks by using blobs and particle simulaton (and look like crap, if you dont live in the 1980s, CG-wise).
      There are quite a few companies that make fluiddynamic plugins for maya or 3ds, and _those_ produce really good results.

      --
      HI O WISE PRINCE. WHT TOOK U SO DAM LONG?
    2. Re:POVRay fluid simulation. by Lady+Jazzica · · Score: 3, Informative

      Actually, the "Liquid Animation" series by fidos uses the Navier Stokes equations.... If anyone's interested, look for them here; the last one was posted on May 20, 2006.

    3. Re:POVRay fluid simulation. by Creepy · · Score: 2, Informative

      Huh?

          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 original poster - I haven't looked at it since the early 1990s myself, but technically bad looking fluid effects would not be its fault since it should theoretically be possible to use ray tracing to give a perfect particle simulation (provided you have enough particles) and given correct physics calculations.

      Discrete Geometry - a field that studies finitely surfaced objects (e.g. polygons)
      Differential Geometry - the study of curved geometric shapes (e.g. spheres)
      Discrete Differential Geometry is something in-between the two - creating a discrete representation of a differential system is probably the best explanation I can give.

      The NSE compute a discrete system (a finite set of points in practice).

  2. Not just "a bunny" by exp(pi*sqrt(163)) · · Score: 4, Informative

    That's the Stanford Bunny.

    --
    Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  3. video is gone by brunascle · · Score: 4, Informative

    hmm... the video i was talking about is gone, replaced by the 2nd one under "Multimedia." sorry about that. the other 2 are still good though. the smoke is in the first one. too bad, though, the snowglobe was great.

  4. More Cutting-Edge Graphics Videos by cyberanth · · Score: 5, Informative

    Ron Fedkiw at Stanford also has a lot of very impressive demonstrations of liquids, smoke, fire, cloth, rigid bodies, elasticity, and fracturing. The videos are definitely worth checking out: http://graphics.stanford.edu/~fedkiw/ I especially like the water being poured into the glass. It's nearly photo realistic.

  5. Re:Can someone post links to the videos? by bumby · · Score: 3, Informative
    --
    Hey! That's my sig you're smoking there!
  6. Re:Fluids in games by samschof · · Score: 2, Informative

    The "breaking problems into smaller pieces" here is simply the spatial descritization. In this case, tets in 3D or triangles in 2D. They are partitioning the physical domain into a set of small regions, basically like finite elements or finite volume methods. The divergence free constraint and viscous terms still result in a global linear algebra problem to be solved at each time step. So, in this case, it doesn't really have anything to do with multi-core processors. It isn't any more (or less) amenable to parallel computation than most other methods.

  7. Re:Roughly analygous to FEA? by bockelboy · · Score: 5, Informative

    No, it has nothing to do with the finite element/difference methods at all.

    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.

  8. Re:Roughly analygous to FEA? by samschof · · Score: 2, Informative
    With the disclaimer that I only gave the paper a cursory reading...

    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 integral of the vorticity in the fluid.

  9. Re:Fluids in games by Rufus211 · · Score: 3, Informative

    Full water is a ways off since it requires a large area to be simulated (well, you can simulate puddles, but not anything you can swim through). However real smoke animates are on their way since you can easily confine smoke to a reasonably small area. Nvidia's smokebox demo was created to show off the 8800's processing power with realistic smoke rendering, and the results of that demo are already being integrated into games. Movies more information are on the creator's website:
    http://graphics.cs.uiuc.edu/svn/kcrane/web/project _fluid.html
    http://www.gametrailers.com/player.php?id=15381&ty pe=mov&pl=game

  10. Paper by MajroMax · · Score: 4, Informative

    What the CFD-literate Slashdotters will want to read is the actual paper (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.

    --
    "Evil company X is threatening to restrict our rights! Let's all get together to stop--OOOH! SHINEY!!!" -- AC
  11. Re:Fluids in games by Anonymous Coward · · Score: 4, Informative

    Bump mapping was invented in 1978 by James Blinn and has been available in non-realtime rendering ever since. By 1996 it was a reasonably common effect in realtime software renderers (as in, everybody who wanted to show off their coding skillz had to have bump mapping in their rendering engine). But it was not easy to do bump mapping with the first-generation consumer-level 3D accelerators like 3dfx voodoo so people basically forgot about it as they moved onto hardware accelerated graphics... Until pixel shaders reintroduced the programmable pixel pipeline.

  12. Re:Roughly analygous to FEA? by bockelboy · · Score: 2, Informative

    Having a "discrete derivative-like operator" was just an example of what one might do along these lines.

    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 solution, as its error is going to be O(h^2), where h is the step size. So, if you discretize the problem with the traditional central differnce, set it up as a matrix problem and solve the matrix with *no error at all* (and there will be error, as you're doing numerics on a computer), your solution is going to have O(h^2) error.

    On the other hand, if you approximate the derivative using sinc methods, the error is O(2^h). This means that your numerical solution is going to be a much better approximation to the true solution.

    Moral of the story? Even though, in the limit as h -> 0, or as your discrete geometry approaches a continuous one, how you get there is going to make a huge difference in what your solution is going to be.

  13. Re:It's not clear by pfafrich · · Score: 3, Informative

    The research group's publications might shed a bit more light on how this works.

    --
    There are four sorts of people in the world: fools, lunatics, idiots and morons. - Umberto Eco, Foucaut's pendulum.
  14. Re:I was hoping for a different bunny by spun · · Score: 2, Informative

    I bleed easily. And I tend to pee myself in court.

    --
    - None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
  15. Re:Fluids in games by deuterium · · Score: 2, Informative

    I've never understood why more attention isn't given to Lattice-Boltzmann methods of CFD. The algorithm is less costly, and as accurate as NS along with being highly parallelizable. PowerFLOW uses an integer based LBM, and has had great success. The conceptual problem seems to lie in centuries of continuous domain equations, which computers simply aren't designed to implement natively. People are too married to calculus.

  16. Re:It's not clear by carlossch · · Score: 2, Informative

    Jos Stam's stable fluids (SIGGRAPH 99) was one instance of a technique that looked better but wasn't exactly more accurate (specifically, Stam presented an unconditionally stable solver based on the Hodge-Helmholtz decomposition principle. Great for graphics, horrible numerical dissipation). Desbrun et al are solving Euler's equations for inviscid flow. The new thing is that their formulation of the equation on a discrete setting (solving it on a simplicial mesh instead of on a continuous field) provably conserves vorticity exactly, without numerical dissipation. The paper is available on their Caltech page, just google for it.

  17. Re:It's not clear by Pseudonym · · Score: 4, Informative

    Remember that just because a simulated fluid flow "looks" more accurate, that doesn't mean that it is.

    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.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});