Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev...

21
Realistic Simulation and Rendering of S CSE 788.14 Class Project Presentation Oleksiy Busaryev

Transcript of Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev...

Page 1: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Realistic Simulation and Rendering of SmokeCSE 788.14 Class Project Presentation

Oleksiy Busaryev

Page 2: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Project Goals and Methods

• Realistic visualization of smoke behavior• Simulation: inviscid incompressible fluid flow• Rendering: high albedo, multiple scattering

Visual Simulation of SmokeFedkiw, Stam, Jensen SIGGRAPH ‘01

Efficient Simulation of Light Transport in Scenes with Participating Media using Photon MapsJensen, Christensen, SIGGRAPH ‘98

Fluid Simulation for Computer GraphicsBridson ‘08

Page 3: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Eulerian vs Lagrangian

• Eulerian approach (we use)– fixed space tesselation (grid)– quantities defined on a grid– good for gas & fluid simulation

• Lagrangian approach– particle-based simulation– granular materials (sand) & fluid

Page 4: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Computational Grid

• Staggered arrangement• Scalar values in centers• Vector components in faces• Allows O(x2) accurate

central differences:

Page 5: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Fluid Equations (Eulerian)

• Inviscid Navier-Stokes (Euler) equations:

• Density & temperature:

AdvectionIncompressibility

Pressure difference External forces

Page 6: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Fluid Equations (Lagrangian)

• Inviscid Navier-Stokes (Euler) equations:

• Density & temperature:

IncompressibilityPressure difference External forces

Page 7: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Splitting

• Advection (move quantities with the flow):

• External forces (e.g. gravity, buoyancy):

• Pressure difference/mass conservation:

Page 8: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Numerical Algorithm

• Find a suitable time step t• Advect and T in the divergence-free field u• Self-advect the velocity field u• Apply external forces f to u• Enforce incompressibility in u by projection,

producing divergence-free velocity field

Page 9: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Semi-Lagrangian Advection

• Trace density and temperature back in time:

• More accurate 2nd order Runge-Kutta:

• Each velocity component is advected separately

Page 10: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

External Forces & Vorticity

• Gravity & buoyancy:

• Vorticity confinement (combats dissipation):

VorticityVorticity gradient

Page 11: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Pressure Projection

• Project u to the space of divergence-free fields• Subtract pressure gradient p:

• Pressures are obtained from linear systemthat enforces zero divergence for each cell:

Page 12: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Simulation Results

• OpenGL rendering of density & temperature• 64 x 64 x 64 grid• Semi-transparency• Color: temperature• 75 frames• = 9.81, = 350• = 0.01

Page 13: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Light Transport Equation

• Volume rendering of density field required• Absorption, scattering, emission affect light:

Emitted radiance

Absorption + Scattering = Extinction coefficient

Radiance change Phase functionScattering coefficient

Absorption coefficient

Page 14: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Rendering Algorithm

• Discretize LTE using ray marching algorithm:

• How to compute in-scattered radiance?

Emitted radiance

New radiance

In-scattered radiance Previous radiance

Page 15: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Single Scattering• Only rays from light sources are scattered• Smoke volume looks somewhat flat

with emissionno emission

Page 16: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Multiple Scattering• Any light rays can be scattered in media• Environment affects how media is shaded• Global illumination needed

Page 17: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Multiple Scattering Computation

• Direct scattering + indirect scattering:

• Indirect part estimated by photon mapping:

surface photon mapping volume photon mapping

Page 18: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Volume Photon Mapping• Shoot enough photons from light sources • Photons are absorbed or scattered by media• Interacting photons stored in the volume map

Page 19: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Video: Single Scattering

• 75 frames• 10 frames / sec• 800 x 800 px• 5-10 min / frame

Page 20: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Video: Single Scattering + Emission

• 75 frames• 10 frames / sec• 800 x 800 px• 5-10 min / frame

Page 21: Realistic Simulation and Rendering of Smoke CSE 788.14 Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.

Video: Multiple Scattering

• 75 frames• 10 frames / sec• 800 x 800 px• 3-6 hours / frame• Noise! • 100K photons is

not enough! • Add emission