About Gray

Gray (Greiners Raytracer) is a hobby/research project of mine. It is a program that simulates light to produce computer generated images. The technique used is called ray tracing, where a large number of rays are cast against mathematical 3D models to simulate the interaction between light and materials. The result is beautiful computer generated images, like the ones we are used to see in special effects in movies.

Photon Mapping

ProgrammingPosted by Søren Greiner Tue, February 02, 2010 14:04:00
More work from the winter of 2009. Work with caustics using photon mapping. With the photon mapping technique (described by Henrik Wann Jensen) I implemented caustics in Gray. Caustics is the play of light seen when light passes through a transparent object and focuses into intricate patterns on other objects.

To produce these images, I start with with the light source and cast a large number of light rays into my 3D scene. If the rays hits a reflecting or refracting object the light bounces in new directions. When the light hits a diffuse non reflection object the position of the "photon" is stored into a photon map.

The next step is to gather these photons again, but this time starting from the camera. When the camera rays hits a diffuse object the number of photons in the neighbourhood of the hit point is computed. The density of photons (number of photons per area) gives an estimate of how much light has hit this point.

Here is an image. Notice the "shadow" cast by the pawn.