Revision 2 as of 2007-06-13 19:35:25

    IanBaker/FinalProject

CS 348b Final Project - Where There's Smoke

Overview

My project focused on rendering images of physically based images of smoke. Originally I had proposed using similar techniques based on simulating the fluid flow of gases to render fire, but getting the fluid simulator proved more challenging that I estimated, so in the end I decided to render the simpler smoke model. The basic method used is to model the flow of the gas in which the smoke is suspended using the Navier-Stokes equations, generating a density field for the smoke, and then rendering the density field using standard volume rendering techniques.

Implementation

The primary task of the implementation was developing the fluid simulator to so simulate the flow of the gas transporting the smoke. In this I followed the method described in Fedkiw et al.[1]. Specifically, the gas is modeled as an incompressible, inviscid fluid which transports a density field used to represent the smoke. To do this I implemented a solver using the semi-Lagrangian method, which was first described in the computer graphics context by Stam [2].

Conceptually, the structure of the solver is fairly straightforward and can be broken down into three main components, based on accounting for different terms in the equations of flow. The space to be simulated is discretized into a regular rectangular grid, with each cell recording the velocity and temperature of the gas and density of the smoke. At each time step, the flow of the fluid is then simulated by 1) Adding external forces to the flow (e.g. buoyant forces from temperature differences and gravity forces acting on the smoke density) 2) Advecting (transporting) the velocity fields 3) enforcing conservation of mass by solving a discrete Poisson equation for the pressure 4) Advecting the temperture field and smoke density.

In addition to the standard semi-Lagrangian method described above, Fedkiw et al. introduced a "vorticity confinement" term, which I also implemented. The basic idea is that the semi-Lagrangian method tends to excessively damp the flow of the fluid, resulting in overly smooth looking flows. This small scale turbulence can be recovered, however, by adding appropriate external forces to the flow, specifically, forces related to the curl (vorticity) of the velocity field, since this is an indicator of the amount of turbulence locally at the flow.

Once I had the fluid solver, I used it to generate density fields of smoke. To render the smoke, I used PBRT's single scattering volume integrator. I tried several different values for the scattering, absorption and Henyey-Greenstein parameters. High sigma_a values generated a nice black sooty looking smoke,

Results

Below are some images and animations I obtained using these techniques:

Some images comparing different amounts of vorticity confinement, showing the smooth flow and the increased turbulence, with a black smoke.

vcsmoke1.avi

vcsmoke2.avi

An animation of a similar smoke plume with a simulated "wind" blowing and different light scattering properties, yielding a lighter looking smoke. wsmoke.avi

In image and animation of smoke rising from a container. Rather than model the smoke inside the container, I using a decreasing source term of the smoke density from the edge of the opening, to simulate the smoke "bunching up" toward the edges. fsmoke.avi

Challenges

References

Recent