Photon Mapping

Photon mapping is one of many techniques used to render images in computer science. The idea behind photon mapping is rather than cast light rays from the camera to the image (as we did in our first project), cast light rays from the light source to the objects in the scene to see how they reflect towards the camera. Our first project’s ray tracing algorithm is essentially backwards, in that light is represented as traveling away from our eyes towards what we are seeing. This leads to problems rendering caustics, which are groups of light rays coming from different directions reflected towards the same area by a curved surface. Photon mapping is able to render caustics well, meaning that it renders more realistic images than backwards ray tracing.

A Caustic

Caustics created by a glass filled with water

 

Here is a brief overview of how photon mapping actually works:

For each light source in the scene, a group of photons is created and sent into the scene (more photons for brighter lights). When a photon comes into contact with a surface, its direction, energy, and position are stored in the “photon map,” which is implemented using a kd-tree. After colliding with a surface, the photon is either absorbed, reflected, or refracted, based on “Russian Roulette,” a Monte Carlo method. Essentially, a probability function (based on the characteristics of the object) determines whether the photon is reflected, refracted, or absorbed.

 

After the photon map is created, the image is rendered using any rendering technique, such as the one we used in our first project. However, during each ray’s intersection with an object, there is a check to see whether or not there are any photons in the photon map near the intersection. If there are, a component of energy proportional to the number of photons in proximity is added to the ray.

 

Photon mapping is a very slow method if used to render entire scenes. In practice, it is only used to render caustics and sometimes indirect lighting while ray tracing is used to handle the direct lighting. It can also provide information about shadows in the image, among other things. There are many ways to optimize it, including reducing numbers of photons going to less important or less complex areas of the scene, and limiting the initial direction of the photons. Overall, photon mapping is a flexible algorithm (it can be incorporated with many ray tracing techniques and handle only certain portions of the image) and produces realistic results.

An image rendered using photon mapping.
An image rendered using photon mapping

References:

http://en.wikipedia.org/wiki/Photon_mapping

http://www.cc.gatech.edu/~phlosoft/photon/

http://web.cs.wpi.edu/~emmanuel/courses/cs563/write_ups/zackw/photon_mapping/PhotonMapping.html

Posted in Topics: Uncategorized

Jump down to leave a comment.

Leave a Comment

You must be logged in to post a comment.



* You can follow any responses to this entry through the RSS 2.0 feed.