Ray tracing is a process that involves tracing the path of light rays from the perspective of the beholder. It is one method of creating 3D graphics through the use of light. By making use of the path of light, one can create images with extraordinarily life-like or realistic effects.

To render an image through ray tracing, there is a need for a ray tracing program which handles the full range of calculations needed to properly ‘render’ or portray each individual pixel or square of a designated scene. This program allows the user to define what the object or the scene will be without the need for having a real object in place, and it permits the user to manipulate the object or scene.

Its most obvious use of is in the field of entertainment – 3D animation movies, computer games, movie special effects and so on.

The Principles Behind Ray Tracing

The starting point to understand ray tracing is by understanding how we ‘see’ objects in a scene. The best analogy is to think of oneself as watching a scene (for example, a tabletop with various objects on it) through a camera lens or viewer, with the viewer broken up into individual pixels or points where each point matches one ray of light that connects the beholder’s eye to one point on the object.

For example, a 640×480 resolution picture means a grid composed of 640 horizontal pixels and 480 vertical ones. Each pixel corresponds to one ‘spot’ (or point) on the scene or ‘world’ that one is looking at. If one is looking at a plain white surface, what he sees is 307,200 white pixels.

However, if one places a solid, three-dimensional object on the white surface (e.g. a red ball), the ‘picture’ becomes a bit more complex. Depending on the angle from which the light is coming, some of the pixels will be plain white; others will have shades of grey going to black (from the shadow cast by light on the object). Other pixels will have varying shades of red because the shape of the object means that light rays striking it are reflected back in different ways.

If the source of light, moreover, is above the viewer, one can expect an area of non-red where light is reflected back at him (think of the ‘red eyes’ which happens when one shoots a picture of someone who is looking straight at his camera lens).

The picture becomes more complex as more objects are added to the ‘scene’ because light interacts with each object. If the original red ball is painted with shiny, reflective paint, one can expect to see reflections from other objects beside or around it. A transparent ball will have both reflective and refractive properties – it will reflect images of something beside it, but it will also show an object behind it (since it is transparent) but the object behind it is affected by the shape of the object one is viewing it through (refraction).