top of page
Overview

Carson Carroll - Photon Mapping

My favorite lab that I worked on this quarter was the ray tracing lab so I wanted to build a project that built on top of the ray tracer I implemented this quarter.

Photon mapping is an extension to ray tracing.  The idea of photon mapping is to cast photons from the light sources in a scene and collect the lighting information on the objects where the photons make contact with objects. This lighting information, along with the ray tracing, can be used to make more realistic images.

Procedure

Photon mapping is a two pass procedure.  The first pass consists of casting the photons from the light sources.  In my implementation, I build a global photon map for the mapping of the photons for the objects in the scene and then I build a caustics photon map that specifically maps photons that interact with objects that create caustics.

 

The second pass is the rendering pass.  The steps usually taken by ray tracing are taken but as color information from the ray tracing is gathered for each pixel, the photon maps are also sampled at the same point in space and used in the final color calculation.

 

I used Russian Roulette to determine if a photon should be reflected (diffuse or mirror reflection) or absorbed.  The maximum number of times a photon can be reflected off of an object is three times before it dies.  The photon dies instantly if it is absorbed by an object.

Results

This image displays a Cornell Box with three spheres in it. The top left sphere is a red sphere that has high reflectivity, essentially acting like a mirror.  The top right sphere is a blue-purple sphere with some reflectivity.  The bottom sphere is a transparent sphere where light is refracted through it. The sphere creates caustics on the surfaces behind it where you can see a high concentration of light as well as a ring of light behind it.

This scene uses the same techniques describes above with photon mapping and caustic mapping.

The images produced use 50,000 global photons and 8,000 photons for caustics.

 

The images are all 500 x 500 pixels.

References

Structure

The global map and caustic map are both stored in a 3D array structure.  The first dimension is the object type (sphere, plane, etc.).  The second dimension is the shapes of a particular type.  The third dimension are the photon map items that are stored for a particular object.

 

I used a sphere with a radius of 5 to gather the photons for a particular point.  Any point within the sphere when accessing the photon map was used for the calculation of the photon information at that point.

bottom of page