MCIS 625: Computer Graphics
Winter 2004

WEEK 11

Instructor: Dr. Michael Laszlo


Assignment

  1. Please review my slide set on ray tracing.
  2. There is no additional assignment this week.

Ray Tracing
Ray tracing is a rendering technique that supports such realistic visual phenomena as visible-surface detection, shadows, refraction, reflection, a wide range of material properties, and multiple light sources. It works by simulating the way in which light interacts with objects in the world. However, light travels backwards in ray tracing: In ray tracing, rays of light are traced backwards from the viewer's eye—the center of projection— into the scene. This is necessary because it would be too costly to cast rays from light sources into the scene (as happens in reality) since the vast majority of such rays skitter off to infinity without contributing to the image. In the real world, relatively few rays of light ever reach a viewer's eye. By casting rays backwards from the center of projection into the scene, ray tracing ensures that every ray contributes to the final image.

The center of projection (COP), is positioned within the 3D scene, and an image plane is also positioned. Rays are cast from the COP through a window in the image plane into the scene. The window is subdivided into pixels, corresponding to the pixels of the frame buffer. In the simplest case, one ray is cast per pixel. The color of the ray—a function of the ray's interaction with the objects in the scene—is assigned to that pixel. The image is complete when every pixel has been assigned a color.

In ray casting, only a single ray (known as a primary ray) is cast from the center of projection through each pixel of the image-plane window. Which surface a primary ray hits first, and the surface's orientation at that point, determine the color of the corresponding pixel. Ray casting is a visible-surface determination method, but it does not account for visual phenomena such as refraction and reflection.

In ray tracing, additional rays known as secondary rays are spawned as primary rays hit objects. These secondary rays account for the reflective and refractive properties of materials that are hit. As secondary rays strike objects, they in turn spawn more secondary rays resulting in a ray tree. Ray tracing is much more costly computationally than ray casting due to the large number of secondary rays that must be cast, but the images it produces are more realistic.

Ray tracing is so time consuming because of (a) the time it takes to calculate ray/object intersection points and (b) the vast number of such intersection calculations to be performed. Methods for accelerating ray tracing focus both on speeding up such calculations, and on reducing the number of such calculations that must be performed. These methods are critical for making ray tracing practical, and are an even more important factor than the CPU's speed (i.e., ray tracing goes faster with good acceleration methods on a slow CPU than with no acceleration methods on a fast CPU). Parallel processing is also used to accelerate ray tracing; since each ray interacts with the scene independent of all other rays, each ray can be assigned its own processor.

Persistence of Vision (POV) is a public domain ray tracers that runs on many platforms including PCs, Macs, and UNIX. It supports a range of primitive objects as well as constructive solid geometry, and uses acceleration methods to speed up the ray tracing process. The site contains ray traced pictures and links to other sites containing even more pictures.


[ Home | Course | Syllabus ]