Project Overview

Visual Introduction

Closely study the following image (click it to view a larger version).

Take note of the distortion of the glass filled with the yellow liquid (on the left) as seen through the thick glass in front. Consider the shadows cast onto the tiles from the glasses and the dice as well as the shadows on the back wall. On the back wall, notice the various colors projected through objects in the foreground. Consider how the bright white rectangular shapes on the tall glasses are suggestive of a window behind the viewer (through which must of the light in the scene comes).

The aforementioned effects provide for a photorealistic view of a virtual world. These effects can be created through a process known as ray tracing. One can think of ray tracing as a computational approximation of light in a scene traveling to an observer's eye, though implemented in reverse, with the eye as the originating point. In many respects, the goal is to determine the color of each pixel in a scene based on the path that light would travel from the eye through that point in space.

For instance, consider looking at one of the pips on the die in the foreground. Since this die is not entirely opaque, we can see that the majority of the color comes from the die material itself, but that the color in some locations (at some points) is affected by the color of the pips on the underside of the die. This effect reflects the contributions of the light hitting the surface of the die but also passing through to the pip below. Similar effects are seen in the stems of the tall glasses and in the partially melted ice cube.

Over the extent of this project, you will implement a ray caster. Ray casting is a simplification of the the full ray tracing computation. In particular, in ray casting, light will travel from the eye to only a single intersection point (i.e., hitting a single object). As such, the more advanced effects, such as reflection and refraction, will not be computed, but the general framework for such will in place. Furthermore, this project reduces the computational complexity by only considering scenes made up of spheres. So while the final implementation will not allow one to produce images as above, you will be able to produces images like the following.

Applications

Ray tracing, as a visual effect, is primarily used in artistic endeavors. Such examples include movies, games, and computer art. For instance, the following image (taken from "Ray Tracing for the Movie 'Car'", Christensen, et. al.) illustrates the use of ray tracing to add reflections of neighboring cars on the shiny exteriors of different characters.

Additional examples across various industries, including scientific visualization and virtual prototyping, are presented in "Ray Tracing in Industry", Pacheco. For example, the following images illustrate the use of this technique for prototyping in industrial design and manufacturing.