Math 155B - Intro to Computer Graphics II - Winter 2005

Project #4 - Distributed Ray Tracing

Overview:  For this assignment you will modify a "basic" ray tracer to incorporate distributed ray tracing effects.   You will also create a simple scene by modifying RayTraceData.cpp or RayTraceData2.cpp in order to learn how to use the ray trace software.

Due date: Wednesday, February 16, midnight.

Turn in:  Post a web page for public display and save your functioning source code in a folder Project4 in your ieng9 class folder.

What to do:

  1. Get the source and project files.   Download from the text's Ray Trace web site, the file  This contains a large C++-project.  Extract the files, maintaining the directory structure.   Because of bugs in Visual C++ file name handling, make map a network drive "Z:" to point to your class home directory.  To do this, choose "Tools" -> "Map Network Drive...".  Then map Z: to "\\acsnsf4\unix-home\solaris\ieng9\cs167f/cs167f\userid" (get the correct name by cut-and-pasting from your course home directory).  Inside the Z: folder, double-click on RayTrace/RayTrace.dsw, and let the compiler create a .sln solution file and upgrade all the projects to Visual Studio C++.  You should now be able to compile and run the program. 

  2. Look at the sample images and read the overviews on the web.   Appendix B in the book describes the Release 1.0 version of the software.  There is a supplemental page that describes the differences between Release 1.0 and the Release 2.0 versions of the software.    We will discuss the functionality of the programs RayTrace.cpp, RayTraceData.cpp and RayTraceData2.cpp.
  3. Run the main project RayTrace (make that the "active" or "startup" project in Visual C++, by using the menu that pops up when you right click on the project name).  At first there is a small OpenGL rendered window.  Press "g" or space to switch to ray tracing mode.  Press "G" to return to OpenGL rendering.  Use arrow keys to adjust the view position, and HOME/END to adjust the distance.  Resize the window bigger, but be prepared to wait longer if you use the "g" command to render with ray tracing.
  4. Try the same experiments with the more complicated scene in RayTrace2.  (This has a variant of the textbook's cover design.)  Make sure you make RayTrace2 the active or "Startup" project.
  5. For large windows, be sure to be using Release mode or some optimizing compiler.  Release mode is much faster than Debug mode and is selectable from the Build menu.
  6. Look at the documentation in the appendix.  Look at the source code in RayTrace.cpp, RayTraceData.cpp, RayTrace2.cpp, and RayTraceData2.cpp.  This will look confusing at first, but I will go over a lot of it in class on Wednesday.  As part of this you will need to learn the basic functionality of the VectorR3 and VectorR3 classes for 3-vectors and 4-vectors.

  7. Change the scene shown in either RayTraceData or (recommended) RayTraceData2.   If you use RayTraceData2, consider deleting some of the shapes to make the scene less cluttered.  Add at least a couple new shapes or colors or textures to learn the basic functionality of defining a scene.
  8. In the main program, add three types of distributed ray tracing features.   These three kinds should be chosen from:
        a. Anti-aliasing with jittered subpixels,
        b. Depth of field,
        c. Motion blur, and
        d. Soft shadows.
    If you implement only one or two of these four, you will still receive substantial partial credit.  Be sure to combine multiple techniques wisely, with "random permutations", etc.
  9. Create a web page that shows your work.  At a minimum it should show the scene twice, once rendered without distributed ray tracing and once with distributed ray tracing, and you should be able to point out the differences in the two scenes.  You may also find it have multiple images that show the effects of each distributed ray tracing technique separately.
  10. Upload your web page to the class project 4 upload page.  Keep your code functioning on ieng9 until you are graded.

Grading:  You will be graded on how well you implement distributed ray tracing, how well your images show the advantages of distributed ray tracing, number and difficulty of the features implemented, and the overall scene design.  Grading is based on the web page you upload, and on your discussions with the TA.

Handout: How to jitter the eye position.