In computer graphics, photon mapping is a global illumination algorithm based on ray tracing used to realistically simulate the interaction of light with different objects. Specifically, it is capable of simulating the refraction of light through a transparent substance, such as glass or water, diffuse interreflections between illuminated objects, and some of the effects caused by particulate matter such as smoke or water vapor. It was developed by Henrik Wann Jensen.
With photon mapping, light packets (photons) are sent out into the scene from the light source. Whenever a photon intersects with a surface, the intersection point, incoming direction, and energy of the photon are stored in a cache called the photon map. As each photon is bounced or refracted by intermediate surfaces, the energy gets absorbed until no more is left. We can then stop tracing the path of the photon. Often we stop tracing the path after a predefined number of bounces in order to save time.