CS 6620 - Fall 2014 - Ray Tracing for Graphics

Project 13 - Photon Mapping

In this project we will replace path tracing for indirect illumination with photon mapping.

Requirements

Implement photon mapping.

Render a scene using only photon mapping for illumination (direct and indirect).

Render a scene using photon mapping for indirect illumination only.

Make sure that point lights have inverse square fall-off.

Source Code

The following source code files are provided to help you with this and upcoming projects. You are not required to use them, but it is highly recommened that you use some of them. Some of these files include additional code as compared to the same files in the previous project, so make sure to download them all again.

PhotonMapViz.cpp: Photon map visualization tool. Compile this tool separately. It loads the photon data from a file and displays it as 3D points. You will need to save your photon data to a file before you can use this tool. You may want to scale your photon colors before you save, so that they are not too dark.

scene.h: Includes the photon map extensions for the Light and Material classes as well as changes for supporting multi-materials. The hit information now keeps material ID, which needs to be updated whenever a hit is found.

materials.h: Includes the the photon map extensions and multi-material.

viewport.cpp: OpenGL based preview and user interface launched by calling the ShowViewport() function based on the GLUT library (the Windows version is here). This version has additional code in the PointLight::SetViewportLight() method that supports inverse square fall-off. I is also updated for supporting triangular meshes with multi-materials.