Physically Based Rendering of Wax (Candles) with Translucence
Jonathan Huang
CS348 Final Project
What Did I Do?
        
My main goal for this project was to implement a BSSRDF integrator in lrt using the hierarchical rendering
technique described in Henrik Wann Jensen's 2002 Siggraph paper. Click Here to see my initial
project proposal. I had originally wanted to render a stone statue using the BSSRDF to achieve the spectacular subsurface
scattering effects that I had seen in papers. Unforunately, I ran into some complications with specular
surfaces in my photon mapping integrator, so I switched to rendering a more diffuse material - wax.
There were several things that needed to get done: implement
a new integrator for lrt that handles translucent objects based on photon mapping, be able to specify in a
file whether an object was translucent or not - I didn't want to render everything using the BSSRDF, just select
objects.
This was my inspiration - it is a green wax candle lit from above by a bright white light source.
Notice
how the light "soaks" into the top few millimeters of the candle.
Implementation Details:
        
I followed Jensen's paper pretty closely. First, I copied my photon mapping integrator from assignment 3 - I
wanted to base the new code on this file. Like Rui Wang from UVA, I only implemented the multiple scattering
term using the dipole diffusion approximation and simply ignored the single scattering term because of time
constraints. The argument is that for highly scattering materials, the multiple scattering term dominates.
Unlike his implementation however, this one uses photon mapping, which allows for a more accurate solution
to scenes where global illuminations factors into the final image in a significant way.
        
The algorithm described in the paper is a two pass technique: in the first pass, we choose a set of uniform
sample points over the surfaces that we want to render as translucent. Then, using photon mapping, we can
integrate over each of these points to estimate the irradiance at each of these. In my implementation, I store
these points in an octree as described in the paper where each parent node holds the total irradiance, area
and average location (irradiance-weighted) of its children. Using this octree, we can do fast approximations
with a controlled error of the radiant exitance at any point on the surface. From this, it is a simple matter
to get the outgoing radiance at some point on the surface.
What Worked Well?
        
The hardest part of this project for me was actually understanding how the algorithm worked. I had to read
the paper over many times before I started to understand how the parts fitted together, and even then, I
learned many things along the way. Instead of using the octree already implemented in lrt, I simply made
my own - there were many functions of the octree that couldn't be accounted for in a standard implementation.
Fortunately, most of these functions were explained very well in the paper and implementing them turned out to
be very straight forward.
What Didn't?
        
One of the first challenges was reconciling the two papers on the bssrdf by Jensen. The equations took a new
simpler form in the second paper, but it took some algebra to convince me that they were
equivalent. It was easy to forget by looking at the formulas given, that most of the quantities were functions
of wavelength, so they had to be stored as a Spectrum. My greatest regret of course is that I was not able to
find a suitable model that I could convert to rib in time. There is an alarming lack of free medium resolution
models of statues online in the rib format!! By using a cube, I was able to skirt the issue of generating
a uniform distribution of sample points on a model. For the candle, I made a simple triangulated
mesh and generated a set of sample points in the following way:
generate a set of points for each triangle proportional to its area, randomly reject points from the
entire set of points until I'm left with the number of samples that I need.
        
I think... the noise is something that comes from photon mapping. I noticed that when I turned up the
number of photons, the noise slowly started to go away. I didn't have time to turn it up really high, but
actually I think the noise looks pretty interesting.
Some Images that I made along the way:
Here, I blacked out the points that were to be shaded using the BSSRDF.
Above are some random experiments with different material parameters. These were a lot of fun to play with. To change
how "translucent" something was, it was a simple matter to change the mean free path.
In Conclusion...
        
I thought for sure that this process would be really slow after seeing how many samples I needed to take on the surface.
Surprisingly I got times that were comparable to the regular photon mapping (with finalgather). I wish I could
have rendered a complex model, but time simply did not permit me to. I really enjoyed reading the papers
and learning about the dipole diffusion approximation - it reminded me of the elegant mirror charge solutions
to some electric potential problems from electrostatics. One day, I hope to actually find a good model
to render using this technique. Below are my renditions of a candle. The first one was done using the
photon mapper from assignment #3, the next three are versions rendered with the bssrdf.
Works Cited:
A Practical Model for Subsurface Light Transport
Henrik Wann Jensen, Steve Marschner, Marc Levoy, and Pat Hanrahan
Proceedings of SIGGRAPH'2001, pages 511-518, Los Angeles, August 2001
A Rapid Hierarchical Rendering Technique for Translucent Materials
Henrik Wann Jensen and Juan Buhler
Proceedings of SIGGRAPH'2002, pages 576-581, San Antonio, July 2002
Rendering of Wet Materials
Henrik Wann Jensen, Justin Legakis, and Julie Dorsey
Rendering Techniques '99 Eds. D. Lischinski and G.W. Larson. Springer-Verlag, pages 273-282, 1999
Modeling and Rendering of Weathered Stone
Julie Dorsey, Alan Edelman, Henrik Wann Jensen, Justin Legakis, and Hans Kohling Pedersen
Proceedings of SIGGRAPH'99, pages 225-234, Los Angeles, August 1999
Many Thanks to:
Matt Pharr, Ian Buck for making cs348b a great experience, Arturr for not letting me nap, and Jenn for making me program
=)