Final Project: Lava / Molten Material

Project Goal

Implementation

A true black body is an ideal diffuse radiator -- it emits light and absorbs all incoming light. Although most materials are not true black bodies, lava and other molten metals do emit an approximate black body spectrum. The black body power distribution function at each wavelength is specified completely by the temperature of the material.

Therefore, to determine the emitted light from a point on a surface of a given temperature, we integrated the product of the black body power distribution function and the XYZ response functions over the visible spectrum to end up with an XYZ color representation of the spectrum. This XYZ color was converted to RGB for use as the emitted light of an area light.

As mentioned above, a black body radiator absorbs all incoming light. However, no materials are ideal black body radiators; as lava cools it becomes reflective. Looking at our reference images, we saw a broad specular highlight on the lava, which had cooled to a rather bumpy surface. We decided to approximate this appearance by using a Blinn microfacet distribution with a high degree of roughness and a bump map. However, we wanted to correlate the reflectivity of the surface with the temperature -- high temperatures would be less reflective -- so we provided configuration parameters for smoothly transitioning the weight of the BSDF.

Final Images

Challenges / Interesting Investigations

Our initial implementation of the black body code had a bug which made the emitted power far far too low for what PBRT was expecting. This led to a wide range of investigations trying to find out what techniques were used for color representation of black body radiation.

First, there are many black body radiation color-temperature gradients on the web. Here is an example: <example image>

However, these gradients are created by "self-normalizing" the color returned by the black body spectrum integration -- divide each of the XYZ color values by the sum of the XYZ values for a particular color. This means that you can represent the colors nicely, but it does not represent the intensity of the color properly at all. The emitted power of a black body increases as temperature4, so higher temperatures are orders of magnitude brighter than lower temperature, and the color gradients do not represent this. For instance, 1500K should be bright yellow, but the color gradients expect it to be orange.

A paper by Fedkiw, et al. called "Rendering of Fire" uses the black body radiation method as well, and they use a von Kries transform to approximate chromatic adaptation. They assume that the fire in their scene is the primary illuminant, and use the von Kries transform to scale all colors to the color of the maximum temperature. This has the effect of saturating the color of the maximum temperature to white, which might be an okay idea for fire; but it does not apply well to lava or molten metal. For instance, we wanted to be able to represent metal at 800 kelvin, which should be a dark red. If this was the only illuminant in the scene, adapting to it would force it to white, which is really not correct.

A paper by some dudes about rendering explosions does two interesting tricks with the black body spectrum: 1) if they are looking for a particular color, they compute the temperature for which the maximum intensity is at a wavelength near that particular color, and then run their simulation at that temperature 2) additionally, they allow artists to specify the range of wavelengths over which to evaluate the black body radiation, which biases the resulting color. We chose not to apply either of these techniques because we wanted to base our results off a reasonable temperature for the materials we were looking at.

As it turned out, our black body code just had one of the constants off by scale factor (m2 instead of nm2), which threw off the whole computation when it was divided by wavelength5. Going over the code in detail found this error and made the resulting Le in the right range and color.

Future work

References