Sunday, June 7, 2009

1.24 Caustics

 
1.24 Caustics
 
Caustics are light patterns that are created when light from a light source illuminates a diffuse surface via one or more specular reflections or transmissions. Examples are:  The light patterns created on the bottom of a swimming pool as light is refracted by the water surface and reflected by the diffuse pool bottom.
 
 Light being focused by a glass of water onto a diffuse table cloth.
 The light emanating from the headlights of a car: the light is emitted by the filament of a light bulb, reflected by a parabolic mirror reflector (thereby being focused in the forward direction), and reflected by the diffuse road surface.
 
Caustics cannot be simulated efficiently using standard ray tracing since predicting the potential specular paths to a light source from any given surface is a difficult (and in many situations impossible) task. To overcome this problem mental ray uses a photon map.4 The photon map is generated in a preprocessing step in which photons are emitted from the light sources and traced through the scene using photon tracing.
 
The emission of photons is controlled using either one of the standard photon emitters for point lights, spot lights, directional lights, and area lights, or by using a user defined photon emitting shader. A photon leaving the light source can be reflected or transmitted specularly by objects.
 
The photon is traced through the scene until it either hits a diffuse surface or until it has been reflected or transmitted a maximum number of times as indicated by the photon trace depth. When a caustic photon hits a diffuse object it is stored in a caustic photon map and not traced any further.
 
To control the behavior of photons as they hit objects in the scene, it is necessary to attach photon material shaders to these objects. Photon material shaders are similar to normal material shaders with the main difference being that they trace the light in the opposite direction.
 
Also, a photon shader distributes energy (flux) instead of collecting a color (radiance). Another important difference is the fact that photon material shaders do not need to send light rays to sample the contribution from the light sources in the scene.
 
In order to use the photon shaders, it is necessary to include the physics.mi file which contains the declarations of all the physics-based material shaders and photon shaders ? or the softimage.mi file which contains the Softimage material shader and photon shader. To turn caustics on, specify caustic on in the options or use the command-line option -caustic on.

No comments: