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.
materials.h: Includes the the photon map extensions.
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 only has additional code that is commented out for PointLight::SetViewportLight() method that supports inverse square fall-off.
Test Scenes
The following scene files are provided to help you test your implementation. You can also prepare other scenes to show your work.
Cornell Box: A Cornell box scene with a Utah teapot and two spheres.
Optional Feature Suggestions
Add a Monte Carlo sampling bounce for indirect illumination.
Implement precomputed irradiances to achieve higher performance.
Implement final gathering using importance sampling based on the photon map information.