Photon Mapping
May 2005

Description
This program impliments the use of a photon map to simulate global illumination and caustics into the raytracer we've been working on.

Source Code
The source code consits of the following files:

  • rayTracer_03.C
  • vector.H
  • vector.C
  • color.H
  • color.C
  • materials.H
  • materials.C
  • ray.H
  • ray.C
  • matrix.H
  • matrix.C
  • objects.H
  • objects.C
  • myMath.H
  • myMath.C
  • PhotonMap.H
  • PhotonMap.C
There is a Make file that compiles the program

Problems
The biggest problem I had was scaling the power of the photons so that they wouldn't blow out the image. I ended up scaling the photons power by 0.125. This is no where near where it should have been (1/number of emmitted photons). The only thing I can think is that I wasn't using the correct start power for the photons.

Final Rendered Image I shot 500,000 photons and reduced their power by 0.125 in order to get this image.

Photon map used to create final image
Here are sample images of the photon map as I was trying to get the right settings