Assignment #4 -- Ray Tracing and Shading
Due Date
This assignment is due at 11:59pm on Thursday, April 15th. Projects
turned in late will lose points as described in the policies
handout. This assignment should be done alone or in pairs. You may
share ideas with other groups, but you may not share code.
SUBMISSION DETAILS
You may submit on either Unix or Windows. The platform you submit on will
be the one used to grade assignments.
Do not touch any file after the submission date. Readers will check
the file time stamps. Regardless of which platform you used for the assignment,
you should have an as4 directory in both of your Unix and Windows accounts.
You should put a README file into both of these directories that at the
minimum contains the following data:
-
Your (and your partner's) name,
-
The platform your code runs on,
-
The location of your source code (i.e. indicate who in your group has
done the submission, Windows or Unix). So only one of you in your group
needs to submit the code, but everyone has to create as4 directory
that contains the README file.
You should also e-mail your README file to cs184@imail.eecs.berkeley.edu.
On the subject line you should specify your account names and the
assignment number (e.g: cs184-aa, cs184-ab: as3).
All files needed to compile your code should appear in the Windows or Unix
directory of the user indicated in your README file. It is your
responsibility to make sure that they will compile and run properly.
You will also need to set the permissions properly.
You will also turn in some images. These should be names
"image-nn.xxx" where nn is a number (e.g. 01, 02, 03...) and xxx is an
appropriate extension (e.g. tif, jpg, ppm, etc.) The main input files
needed to render those images should be named "input-nn". Finally
there should be a "notes-nn" file for each input stating: the command
line used to produce image-nn, how long it took to run, what features
are demonstrated by the image, any other comments you'd like to add
about the image.
Windows: The grader should be able to recompile your program by
simply opening the project and rebuilding it from scratch.
Unix: Remember that the grader should be able to recompile
your program simply by typing make.
Do not wait until the last minute to start this assignment. Even
a minor bug in a ray tracer typically produces a black image with no
other clue about what is wrong... that makes them very hard to
debug. If you don't give yourself enough time, you will be most
unhappy.
Overview
For this assignment, you will write a ray tracer that can at least:
- Render ellipsoids
- Render polygons
- Use simple Phong Shading (in color)
- Compute shadows
- Compute reflections
- Use point and directional lights
- Use some reasonable method for accelerating ray tests
- Write its output to a standard image format such as jpg, ppm,
png, or tif.
Optional features that you can implement for extra credit are:
- Transparency with refraction
- Anti-aliasing
- Lens effects / depth of field
- Super quadrics
- Programmable shading
- Texture, bump, and/or displacement mapping
- Spot lights and/or area lights
- Other interesting features
You will use your program to render 5 or more example scenes that
demonstrate the features you have implemented. You will turn in the
images rendered by your code, the code, and some documentation (see
above). Your images must demonstrate the features you implemented or
you cannot get points for those features. You will also receive
points for the aesthetics and creativity demonstrated by your images.
Grave Warning: It will be considered cheating to turn in image
that were not generated by your code. Cheating on an assignment will
earn a zero for the assignment and possibly subject you to
disciplinary action.
File Formats
The input file can be in any format you like. You are responsible for
coming up with something reasonable and creating inputs for
interesting images. An input may consist of multiple files.
Your output needs to be in a standard image format that most image
viewers can read. Suggested formats are: JPEG, TIFF, PNG or PPM. Do
not use an indexed color format. You can write your own code to write
the files or you can use a standard library. PPM is very easy to
write, but offers no compression. JPEG, TIFF, and PNG are supported
by many standard libraries. (libTIFF, libPNG, ImageMagik, nd many
others) You are responsible for figuring out how to use these
libraries.
Your images should be at least 640x480 and no more than 1024x1024.
Comment
This assignment is purposefully open ended. I am continually
impressed by what Berkeley undergrads can do when given a bit of
freedom, so here it is. You are encouraged to be creative and enjoy
this assignment.
Questions should be posted to the news group