fluid simulation and control for computer graphics

38
Fluid Simulation and Control for Computer Graphics Michael Bang Nielsen Aarhus University

Upload: dept-of-computer-science-aarhus-university

Post on 06-May-2015

3.622 views

Category:

Education


3 download

DESCRIPTION

Physically accurate computer simulations of fluids such as water, gasses and air have for many years been a valuable complement to experimental methods in examining the flow around airplanes, cars, wind turbines etc. Recently physically based simulation of fluids has also been adopted in computer graphics, where such techniques are required to faithfully reproduce the visually complex motion of fluids that is very hard to animate in a traditional sense. However, the demands are different in graphics where the visual properties of the fluid have to impose character on the fluid in addition to adhering to the vision of an artist or a director. This poses entirely new research challenges for fluid simulation in computer graphics where artistic control, low simulation cost and visual richness are in focus. In this presentation I will motivate the use of physically based fluid simulation for computer graphics, show examples of state of the art and go into more depth with a recent fluid control framework developed at Aarhus University in collaboration with DreamWorks Animation and Digital Domain. I will elaborate both on the final technique and results as well as on the process that took us there, including challenges faced and approaches that turned out not to be successful.

TRANSCRIPT

Page 1: Fluid Simulation and Control for Computer Graphics

Fluid Simulation and Control forComputer Graphics

Michael Bang NielsenAarhus University

Page 2: Fluid Simulation and Control for Computer Graphics

What is Computer Graphics?

• Modeling– Geometry– Appearance

• Animation– Keyframes– Motion Capture– Simulation/Synthesis

• Rendering– Offline– Realtime

Page 3: Fluid Simulation and Control for Computer Graphics

What is Physically BasedAnimation?

• Rigid bodies• Deformable objects• Cloth• Hair• Fluids

– Water– Smoke– Fire– Air

Important for games, but what about movies and commercials?

Page 4: Fluid Simulation and Control for Computer Graphics

Why Computer Generated Effectsfor Movies and Commercials?

Real world smoke and water phenomena are very complex

Page 5: Fluid Simulation and Control for Computer Graphics

Why Computer Generated Effectsfor Movies and Commercials?

Ivan Aivazovsky, ”The Ninth Wave”, 1850.

It requires remarkable talent and a lot of time to do..

Page 6: Fluid Simulation and Control for Computer Graphics

Why Computer Generated Effectsfor Movies and Commercials?

And real phenomena have scale…From Rikitt: Special Effects

Page 7: Fluid Simulation and Control for Computer Graphics

Why Computer Generated Effectsfor Movies and Commercials?

And real phenomena have scale…From Rikitt: Special Effects

Page 8: Fluid Simulation and Control for Computer Graphics

Why Computer Generated Effectsfor Movies and Commercials?

But sometimes physical effects work.Copyright Cinefex.

Page 9: Fluid Simulation and Control for Computer Graphics

State of the Art in Fluid Simulation for Computer Graphics

1: http://www.scanlinevfxla.com/la/en/reels.html

2: Sequence from Golden Compass

Molemaker et al.

Page 10: Fluid Simulation and Control for Computer Graphics

State of the Art in Fluid Simulation for Computer Graphics

But don’t be fooled: Artists spenda lot of time making raw simulations look good

Copyright Twentieth Century Fox.

Sequence from Day After Tomorrow:

Page 11: Fluid Simulation and Control for Computer Graphics

How do we Simulate Fluids for Computer Graphics?

Math, Physics, Computer Science, Fluid Dynamics and Computational Fluid Dynamics (CFD)

From John D. Anderson: Computational Fluid Dynamics

Page 12: Fluid Simulation and Control for Computer Graphics

Fluid Simulation for Computer Graphics

• Should be visually plausible

• Physical accuracy not paramount

• Animators/directorwant a certainvisual style

Demands are different than in CFD:

Page 13: Fluid Simulation and Control for Computer Graphics

Fluid Simulation for Computer Graphics

• Simulation speed –deadlines and interactive preview

• The fluid should have character

• The artists want control – it should be possible to sculpt the fluid

From Inkheart. Image by Double Negative

Production designs by Jon Brooks

Page 14: Fluid Simulation and Control for Computer Graphics

Collaboration between

• Michael Bang Nielsen• Brian Bunch Christensen• Nafees Bin Zafar• Doug Roble• Ken Museth

Guided Fluid Simulation

I will share both our successes and frustrations with you!

Page 15: Fluid Simulation and Control for Computer Graphics

Guided Fluid Simulation MotivationCoarse Simulation

Fine Simulation

Our Contribution:Guided Fine Simulation

Page 16: Fluid Simulation and Control for Computer Graphics

Guided Fluid Simulation Motivation

Low Res Low Res UpsampledHigh Res

Page 17: Fluid Simulation and Control for Computer Graphics

Guided Fluid Simulation Problem Statement

• Mathematical model• Algorithms• Data structures

That make it possible to guide a high resolution fluid simulation using a low resolution simulation

Develop

Page 18: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Fundamental Idea

The low frequencies of the fine simulation should be equal to the

frequencies of the coarse simulation

Challenge: Formulate this mathematically

Page 19: Fluid Simulation and Control for Computer Graphics

The One-Slide Fluid MechanicsCourse

Volma

VolF

=maF = aVolF

=ρ1

Net force = mass x acceleration⇒ ⇒

Page 20: Fluid Simulation and Control for Computer Graphics

The One-Slide Computational Fluid Mechanics Course

In computer graphics we apply Operator Splitting:

Advection

Body forces

Incompressibility

Page 21: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationHow do we attack the problem?

The low frequencies of the fine simulation should be equal to the

frequencies of the coarse simulation

Advection

Body forces

Incompressibility

Page 22: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Force-Based Approach

• Forces (all or low frequencies)

• Blending of divergence free velocity fields– Leads to results that are too smooth

Thuerey et al.

Page 23: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationHow do we attack the problem?

The low frequencies of the fine simulation should be equal to the

frequencies of the coarse simulation

Advection

Body forces

Incompressibility

Page 24: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

ApproachObservationSolving for Incompressibility

subject to the constraint

is identical to the minimization of

Page 25: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

ApproachWe add the constraint

to the minimization of

subject to the constraint

Page 26: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Approach

Calculus of variations leads to the equations

Does it work?

Page 27: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Approach

Problems:• Matrix singular when filter is wide• Where should we place the constraints?

Test-simulations in Matlab

Page 28: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Approach

Fundamental question:

Does our approach fail completely,or can we modify it somehow?

Page 29: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Second Approach

The low frequencies of the fine simulation should be as close as possible to the frequencies of the

coarse simulation

Challenge: Formulate this mathematically

Page 30: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Second ApproachWe add the minimization term

to the minimization of

subject to the constraint

Page 31: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Second Approach

Calculus of variations leads to the equations

Does it work?

Page 32: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Second ApproachVerification in 2D

Page 33: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Second Approach

Fast to solve, but 1602 requires roughly 2GB and we want to do it in 2563…

Page 34: Fluid Simulation and Control for Computer Graphics

Computational challenges: • Sparse entries take up 4.04TB in resolution 2563

• We reduced this to 208MB• Linear system is a-symmetric

• Solution: Improved multigrid solver• Linear system is slow to solve

• Solution: Parallel solver using separable lowpass filters

Guided Fluid SimulationThe Modified Pressure Projection

Second Approach

Page 35: Fluid Simulation and Control for Computer Graphics

Guided Fluid SimulationThe Modified Pressure Projection

Second Approach

• Boundaries traditionally hard to use withmultigrid

• Which lowpass filter should be used?• How do we handle non-physically based

guiding velocity fields?

More computational challenges:

Page 36: Fluid Simulation and Control for Computer Graphics

ResultsInterpolation between strictly guided and unguided simulation

Low res High Res

Page 37: Fluid Simulation and Control for Computer Graphics

Links to More Information

• http://cs.au.dk/research/areas/computer-graphics-and-scientific-computing/

• http://cg.alexandra.dk/2009/05/15/smoke-rendering-demo/

Page 38: Fluid Simulation and Control for Computer Graphics