Assignment 1: Ray Tracing

CMSC 491/635, Spring 2011

Due February 17, 2011


Using any one or more of the techniques discussed in class, modify the simple ray tracer provided to make it go faster. Evaluate your improvements by computing the speedup between the original ray tracer and your improved version for the balls, gears, mount, tetra and tree benchmarks from the standard procedural databases (SPD). Ten points of your score will be allocated based on the ranking speedup you achieve in the class.


First, you will need to get both the SPD programs and base ray tracer to build on your system. Each has a Makefile that should work for building on Linux or Mac. I have a pre-built copy of the SPD programs for Linux on the campus GL machines in


The ray tracer has a solution file for Visual Studio 2009, and XCode file for the Mac. If you want to run the SPD programs under Visual Studio or XCode, you'll need to create a project for them, and possibly fix any simple compile errors that come up. In addition, for Visual Studio or XCode, you might need to adapt both programs to read their command line options from a file (or only run from the command line or from within Visual Studio, where you can specify command-line options). Both programs are self-contained, so you should not need to install any additional libraries.

The ray tracer produces PPM format images. If you do not already have a viewer for these, check out Gimp or ImageMagick. Another option if you choose to run on the campus linux systems is to use the convert program there to convert the image from PPM to JPG to view from your userpages web space.

convert trace.ppm trace.jpg

Don't count any image conversion time, or SPD file generation time in your timing. Do count the entire running time of the ray tracing program (including reading the scene and writing the object). On a Linux/Mac command line, you can do this with the time command. On Windows, you can get the current time at the beginning of the program and at the end, then report the difference.

What to submit

Submit all source files necessary for me to build your project, including headers, C++ files, and Makefiles and/or solution files. Do not submit any generated files, including images, executables, object files, or Windows build files other than the solution file. ALSO submit one readme file informally describing your project. It should include what sources and methods you used, timings and speedups for each benchmark, notes on how to build your project, and a summary of your own assessment of how well it turned out.

Where to get the files, and where to submit

I have created a private class mercurial (hg) repository for each of you on the UMBC GL system. The best repository URL to use depends on where you are checking out the files.If username is your UMBC username, from campus GL machines, use


For remote access you can use


In all cases, you can make a clone of your repository with

hg clone repositoryURL localname

Or with the clone operation from a Mercurial GUI tool. In the resulting directory, you'll find a copy of the sample ray tracer. As you make changes, be sure to commit important points along the way. For command line use, while you are in the local directory, just run

hg commit

Finally, to submit, you must push your changes back to the main repository:

hg push

You can do the push as many times as you want before the deadline.

How to submit

Just push your files back to the main repository by 11:59pm on the day of the deadline.

Show and tell

On February 22nd, I'll present the final speedup numbers for each of you in class. I'll ask each of you to say a few words about how you approached this assignment. No advance preparation should be necessary.