A basic ray tracer traces rays from the eye point and determines the colour of intercept points by tracing rays back to light sources. This approach only considers light that has travelled directly from the light source. Light that has been redirected by reflective and refractive objects in the scene is not taken into consideration. To overcome this inaccuracy, I have added a pre-processing step to my ray tracer that traces rays forward from light sources and deposits "photons" at intercept points in a large three dimensional kdtree. These photons record position, direction and colour of light so that when rays are forward traced from the eyepoint, photons near the intercept points can be added into the standard Phong lighting calculation.
This image was constructed using constructive solid geometry for the wine glass, a nice texture map for the table and was traced using my non-lambertian caustic ray tracer. Photons were traced from the light source on a 150x300 grid and about 83000 were deposited in a kdtree.