CS 312: Computer Graphics -- Assignment 5

Ray Tracing

Due Sunday, November 21, 2010 by 11:59pm


For this assignment, you must implement a program that will render spheres using ray tracing. Your input will be a text file containing information about the view, lighting parameters, and objects in the scene.  The program will output ppm files showing the rendered scene.

I have already provided a significant start to the project with code provided in ~eeaton/public/cs312/assn5/.  However, there are a variety of parts that I've omitted from the program.  Every part where you are required to insert code to complete the assignment is marked with the phrase TODO.  Simply grep all provided files to discover where you need to add code.

Specifically, you must render sphere intersections, support specular and ambient lighting, and implement antialiasing for the final image.  Your final program should be able to render the spheres.scn file corectly.  You may need to modify the makefile and code to eliminate references to any code necessary to rendering polygons if you're not doing the extra credit.

Include several renderings by your program of the provided scenes.  Describe each of those renderings and the parameters used to create them in a README file.  Write a brief shell script that will generate each of your renderings automatically and move them to unique file names.  Be sure to include this demo script with your submission.


Submitting the Assignment

Submit your C or C++ program, all source code, the Makefile, the images, and any other files necessary to run your project.  I must be able to type make on the CS systems and have it produce an executable for grading.  Name your executable "assn5".

In your comments, include information about the computer platform (hardware and OS) you used to develop your program, and be sure to include additional comments as needed to describe your code.  A good rule of thumb is that someone should be able to remove all code from the file and recreate a rough semblance of the result from your comments.

If you developed on somewhere other than the cs systems, be certain that your program runs correctly on the cs systems where it will be graded.  Leave time for this step!

Place all submitted files into a directory named LastnameFirstname-Assn5. Then create a tar archive of that directory, such that the tar file expands to the directory (not a bunch of files). Copy that tar archive into ~eeaton/submit/cs312/username/ (where "username" is your cs system username) to complete the submission.

Be certain to use the names specified above for the directory and tar archive!!


Extra Credit Opportunities

The following are some ideas for extra credit for this project, but you may also explore others of your own choosing.  The maximum amount of extra-credit is noted next to each item.  Completing the extra credit will not be accepted in lieu of completing the main assignment.

Be sure to include a README file in your submission describing your extra credit additions and how to use them.

  1. (up to +20%)  Add code to render polygons.  Your program should then be able to render snowman.scn.
  2. (up to +20%) Handle reflections.
  3. (up to +25%) Incorporate texture mapping into your renderer.
  4. (up to +5%)  Create a new scn file that shows off the features of your renderer by rendering a different scene.