COS 526: Advanced
General | Syllabus | Assignments
There are two example programs provided that make a good starting point for this assignment (apps/rayviewer and apps/raytracer). The first provides an interactive viewer for rays eminating from a camera and intersecting primitives read from a .ray file. The second provides a framework for an off-line path tracing program -- it reads a .ray file and writes an image file.
The starter code provides a function (R3ReadRayFile in R3Graphics/R3Io.C) to read scene files described in .ray format. The syntax of the .ray file format is described here. Those of you who took CS426 will recognize it as a subset of the .ray file format used for the ray tracing assignment (with a few minor changes). Most significantly, groups with arbitrary transformations are not included, which makes intersection and sampling of rays much simpler. A repository of sample .ray files is provided here.
The starter code also provides a class to read, create, and write images. By default, the class supports reading and writing files in .bmp and .ppm formats. It also can support .jpg format, with the help of the jpeg library provided at ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. If you wish to work with jpeg files (they are smaller), download the jpeg distribution tar file, compile the for your platform, put the include file and lib file in a place that the R2Images class can find them (i.e., jpeglib.h should be placed in pkgs/jpeg and libjpeg.a should be placed in lib/), and then comment out the "#define OMIT_JPEG" directive in R2Shapes/R2Images.C. Of course, this is not required.
It is recommended that you develop incrementally (implement in small steps, and test each step separately) and that you do most of your testing on simple, well-designed examples (simple scenes, small images, few paths per pixel, stresses feature of interest, etc.) because execution/debugging times will be quite long otherwise.
The trickiest part of the assignment is to get the importance sampling right. Perhaps the notes by Jason Lawrence, a student in the Fall 2002 class, will help.