CS174b Computer Graphics Programming Assignment 2

Due:  Thursday, February 11 11:59 P.M.

Overview

In this assignment you will augment your ray tracer to overcome some of the shortcomings

The additions to your ray tracer will consist of the following two sections:


Area Lights and Soft Shadows

In assignment 1, your ray tracer implemented point light sources.  Because these lights emit from a single point in space, they create sharp edged shadows that are a trademark of many ray traced images.  The reason for the distinct edges is that a point light source is either fully in visible or fully blocked by an object. A point source can never be partially blocked.

Area lights on the other hand occupy a finite area of space. Since it is possible for an area light to be partially blocked by an object the shadows created will have soft edges. The softness of the edge is dependent on the dimensions of the light source and it's distance from the object casting the shadow.

Area Light Documentation

You should augment your program to be able to handle area lights as well as the original point light sources from assignment 1.


Bounding Hierarchies

Since the addition of area lights will place a large computational load on your ray tracer, combined with the fact that ray tracing is inherently computationally expensive, that next addition that we will examine is that of a bounding hierarchy.  The bounding hierarchy will reduce the cost of ray casting and allow you to render scenes consisting of significantly more objects in less time.

You should implement a bounding hierarchy using the techniques of Goldsmith/Salmon '87 and Kay/Kajiya '86 described in the accompanying handout.  You have the option of using either axis-aligned bounding boxes or arbitrary bounding slabs.  However, you will not receive full credit if you only implement bounding boxes (see Grading).


What you should hand in

Your program should have the same syntax as in assignment one, with an additional parameter -slow to disable the creation of the bounding hierarchy.

For the area light section, you should hand in an image file displaying the effects of area light sources.  Additionally, you should include the scene file (of your own creation) and a README containing how long it took to create the image.

Additionally, sample input files and images for your hierarchy generation are given below.  The pictures are generated by Povray and will not look identical to your output (due to differences in the shading model, etc.).  You will be required to turn in rendered versions of these files (ppm format, 640x480, recursion limit of 5) along with the amount of time required to render (in the README file).  The README file should also contain a description of which parts of the ray tracer that you believe are working, partially working, and not implemented.  This will assist the grader in determining what is causing potential errors in your output and help in assigning partial credit.


Debugging

You may wish to add code that allows you to visualize your bounding hierarchy for debugging purposes.  Additionally, if you plan on implementing bounding slabs, you should begin with slabs that resemble bounding boxes.  Once these are working, you can generalize to additional slab directions.


Grading

The sections will have the following points:

20%    Area Lights
60%    Bounding Box Hierarchy
20%    Bounding Slabs


Late Policy

The homeworks are due at the time specified at the top of the assignment.  You should place your program in the directory ~loginName/cs174/hwk/hwk2 with the appropriate source and data files as well as a README file describing the program and any assignment specific comments.  Additionally, the README should contain the time and date that you finished the program.

A late penalty of 10 points will be applied for every day that your program is late (your program is considered one day late if it is turned in within 24 hours after the deadline, two days for 24 to 48 hours, etc.).  For example, if you turn in the assignment 2 days late and would have gotten an 84, you will receive a 64.  If you wish to continue working on the assignment after handing it in, you should work on a copy of the program since we will be using the timestamps on the files for grading purposes.  You may later submit a updated version for grading, but you will get the grade for your last turned in version (even if it is lower than a previous version).