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

Preview:

Citation preview

Realistic Simulation and Rendering of SmokeCSE 788.14 Class Project Presentation

Oleksiy Busaryev

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

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

Computational Grid

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

central differences:

Fluid Equations (Eulerian)

• Inviscid Navier-Stokes (Euler) equations:

• Density & temperature:

AdvectionIncompressibility

Pressure difference External forces

Fluid Equations (Lagrangian)

• Inviscid Navier-Stokes (Euler) equations:

• Density & temperature:

IncompressibilityPressure difference External forces

Splitting

• Advection (move quantities with the flow):

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

• Pressure difference/mass conservation:

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

Semi-Lagrangian Advection

• Trace density and temperature back in time:

• More accurate 2nd order Runge-Kutta:

• Each velocity component is advected separately

External Forces & Vorticity

• Gravity & buoyancy:

• Vorticity confinement (combats dissipation):

VorticityVorticity gradient

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:

Simulation Results

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

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

Rendering Algorithm

• Discretize LTE using ray marching algorithm:

• How to compute in-scattered radiance?

Emitted radiance

New radiance

In-scattered radiance Previous radiance

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

with emissionno emission

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

Multiple Scattering Computation

• Direct scattering + indirect scattering:

• Indirect part estimated by photon mapping:

surface photon mapping volume photon mapping

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

Video: Single Scattering

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

Video: Single Scattering + Emission

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

Video: Multiple Scattering

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

not enough! • Add emission

Recommended