Photon Mapping

A sample renderer that can render easy 3d scence using Photon Mapping and Ray Tracing

This demo is to implement the photon mapping algorithm and render a simple scene that consists of only spheres and box. The objective is to properly handle reflection, refraction, caustics and area lights.

Photon Mapping was developed by Henrik Wann Jensen. It is a rendering algorithm that, like Ray Tracing, approximates Global Illumination.

The materials had two BRDF components, a diffuse one and a specular one. The sum of the those must be less than one (to conserve energy).

Because in theory a ray will be partly reflected and partly refracted, I used the Russian Roulette to decide whether a ray is being reflected or refracted. I used Fresnel equations to compute the probabilities.

Since I computed the refracted direction according to Snell's (Descartes') law, this implementation also handled 'total internal reflections'. So I set a variable to limit the number of internal reflections.

I also implemented a modification where the direct lighting is computed via the classic Ray Tracing algorithm. Then I incorporated the indirect illumination from photon maps to this direct lighting. Thus for this technique I did not take the photons that represent the direct lighting in the global photon maps into account.

By using this technology, more accurate result without noise can be achieved. Also, without storing photons for direct lighting, I could increase the photon number without worrying the memory.

Report PDF: