Photon Mapping

Below are some examples of the output from a photon mapper that I wrote for CSCI2240: Interactive Computer Graphics.

Photon mapping is an advanced rendering technique which simulates realistic indirect lighting as well as caustics. This two-pass algorithm works by casting photons, which represent packets of energy from the light sources, into the scene. These photons bounce off of surfaces in the scene in a probabilistic way determined by the nature of each surface's bidirectional surface reflectance function. After the photon map is constructed, the rendering phase may begin. This process, similar to ray tracing, first casts rays into the scene from the film plane. Upon reflection in the scene, the ray will gather energy from all photons within a set gathering radius from the photon map. This gathered energy simulates the indirect lighting.

Simple Photon Mapping

Default Render

Above, is an example of a simple scene that has been photon mapped. Small amounts of color from the red and green walls can be seen transmitted onto other areas of the scene.

Diffuse Photon Map

Above, is the diffuse photon map that was generated for this scene. The dots here represent photons recorded at locations in the scene. These photons are used to estimate the diffuse, indirect light in the scene. The photons were relatively low-powered compared to the main source of light in the top of the scene, hence their effect is subtle. There are approximately 45000 photons stored in this map.

Photon mapping with caustics and reflections

Scene with Caustics and specular hilights

In the scene above, there are two spheres. The one closer to the foreground is made out of a glass-like transparent material, and the other one is purely reflective, like a mirror. To simulate the caustic effects, two separate photon maps are used.

Diffuse photon map
Specular photon map

Diffuse Photon map

Approx. 15000 photons stored

Caustic Photon map

Approx. 1800 photons stored

Click here to go back to the list of projects