In ray tracing, a ray of light is traced in a backwards direction. That is, we start from the eye or camera and trace the ray through a pixel in the image plane into the scene and determine what it hits. The pixel is then set to the color values returned by the ray.
|Sometimes the ray misses all of the objects:|
|and sometimes the ray will hit an object:|
|If the ray hits an object, we want to know if that point on the object is in a shadow. So, when the ray hits an object, a secondary ray, called a "shadow" ray, is shot towards the light sources.|
|If this shadow ray hits another object before it hits a
light source, then the first intersection point is in the shadow of the second object.
For a simple illumination model this means that we only apply the ambient term for that light source.
|First Intersection point in the shadow of the second object|
Also, when a ray hits an object, a reflected ray is generated which is tested against all of the objects in the scene.
If the reflected ray hits an object then a local illumination model is applied at the point of intersection and the result is carried back to the first intersection point.
Contribution from the reflected ray
If the intersected object is transparent, then a transmitted ray is generated and tested against all the objects in the scene.
As with the reflected ray, if the transmitted ray hits an object then a local illumination model is applied at the point of intersection and the result is carried back to the first intersection point.
Contribution from the transmitted ray
The reflected rays can generate other reflected rays that can generate other reflected rays, etc. The next sequence of three images shows a simple scene with no reflection, a single reflection, and then a double reflection.
Scene with no reflection rays
|Scene with one layer of reflection|
|Scene with two layers of reflection|
Last changed June 02, 1999, G. Scott Owen, firstname.lastname@example.org
Main ray trace page
HyperGraph Table of Contents.
HyperGraph Home page.