Super-Enhanced Accelerated Raytracer

a class project for CS348B

by Jeremy Ginsberg and Matt Ginzton

June 1998


What is ray tracing?

Ray tracing is a method that allows you to create photo-realistic images of a three-dimensional scene. A raytracer reads a scene description - containing objects, lights, and a camera - and gives you back a picture of what this scene would look like if it actually existed in the real world. If you have an intelligent raytracer and an accurate scene description, the pictures you create can be hard to distinguish from photographs.

How does it work?

A raytracer works a lot like a real camera. A real camera captures all of the light that enters its lens, and records the different colors on a sheet of film. A raytracer does the same thing, using the imaginary camera that you specify in the scene description. The only trick is figuring out which light rays land on which part of the "film" (i.e. the image). To solve this problem, a raytracer sends out millions of rays of light from each of the lights in the scene, and traces each ray's path as it bounces around the different objects in the scene. If a light ray hits an object and is then reflected into the camera, we know that the object will be visible at that point on the image. By tracing rays of light, we can record many interesting visual effects, like shadows, shiny spots, reflections, refraction, and opacity. These effects make ray-traced images look photo-realistic.

To learn more, check out the comp.graphics.rendering.raytracing FAQ.


Project Description

Our assignment was to create a raytracer from scratch, and then use it to create a photo-realistic image of a real scene. The development occured in 3 distinct phases, over a time period of about 8 weeks. Each student implemented the first two phases alone, while the third phase was done in teams.


Image Gallery

We decided to model and render gambling scenes, with cards, dice, and casino tables. Here are some of our images:

Spread Out
(768 x 398 JPEG)

shows all of our raytracer's features... note the machined-bump surface of the cards, their natural bend, rounded corners, and detailed printing. also note the rounded dice, with indented pips and transparency.

Extra large image also available (1536 x 795 JPEG, 715K).

Feeling Lucky
(512 x 384 JPEG)

notice the internal shadowing of the pips in the dice.

Extra large image also available (1024 x 768 JPEG, 461K).

On the Table
(512 x 512 JPEG)

notice the inverted reflection in the pips, the roundedness of the die, and the distorted reflections it causes.

Extra large image also available (1024 x 1024 JPEG, 375K).

Die
(500 x 500 JPEG)
Cube in Cube
(405 x 405 JPEG)

demonstrates the cube-within-a-cube effect, which is a natural consequence of the shape of dice. It shows that we crafted the dice accurately, as this effect can also be seen in real dice.
A First Attempt
(512 x 512 JPEG)

This was our first attempt at a scene. Nothing was enhanced here, except basic color texture mapping on the cards. This was the best image that we could make a mere 2 weeks before the end.
A Second Attempt
(500 x 500 JPEG)

This was a later attempt. The die have CSG pips, the table is texture-mapped, but we still had a long way to go.

Implementation Notes

This project consumed somewhere between 250 and 400 hours per person, over a period of about 8 weeks. We wrote 14,831 lines of code in 23 source files. Most of the work occured in the last two weeks, as we strove to achieve photo-realism in our scene. We worked for over 80 consecutive hours (with minimal breaks) right up to the deadline at 4:00pm on 06/04/1998. Quite frankly, it was a bitch. But somehow I enjoyed it and didn't hate life nearly as much as I did during the end of Bunny World.

Image rendering times were also problematic. For example, our largest image (the 1536 x 795 "Spread Out" scene) needed 6-8 hours from each of 8 Silicon Graphics Octane Workstations, working in parallel. This is why our best images were computed after the project deadline. For comparison, note that Pixar needed 46 days on 117 Sun Sparc 20's, with a total of 294 CPU's, to render the 110,000 frames in Toy Story. And they didn't even use much raytracing.

Enhancing Reality

Here are some basic descriptions of the 6 additional modules we needed to create our images: If you'd like to read about our enhancements in more detail, be sure to peruse our more techincal README file for enhancements.


jeremyg+org@gmail.com