This assignment has been combined with assignment 5 and it will
be worth double a normal assignment, that is, 16% of the final
grade. Rather than giving an extension you must still make a
submission of a milestone for the original deadline, with the
complete assignment to be submitted by the end of Monday November
The Milestone requirement is that you must have completed the
first 3 steps of the original assignment. There will be
a penalty of 20% for milestones which are incomplete or not
submitted. Submit the following three things: a snapshot of your
code along with a scene xml file and resulting
image which demonstrates the requirement.
The new requirements for the complete assignment is that you must
implement the following extensions:
Jittered Super Sampling
This need not be adaptive, but you should consider each of
jittering and super sampling separately by adding additional tags to
your scene file to enable or disable them independently.
For super sampling, you will want to sample the image at regular
locations within each pixel, as if you were building an image at
twice the resolution (or some other resolution). But you should
also observe how some high frequency aliasing problems can still
Observe how adding a small random perturbation to the
direction of each ray fixes the aliasing problem. The amount of
random perturbation should be configured in your xml scene file.
Note that you naturally have high frequency details in your
scenes, such as edges. Likewise if you implement textures
(optional) then the aliasing problems should be even more evident.
You should also try putting high frequency details in your
background colour computation as an easy test, for instance,
choosing a colour modulated by cos(k*(x^2+y^2)) would give low
frequency when looking down the negative z axis, but will have
higher frequency as you cast rays away from this axis (adjust k so
you can observe the aliasing effect). Again, you might want to make
this an option so that you are not stuck with the same background in
all your test images!
Simple Acceleration for Meshes
Compute an axis aligned bounding box for each mesh in your scene.
Test first ray intersection with the box before testing all
triangles in the mesh. Make sure that you can turn on or off your
acceleration method. Measure the improvement for your sample scene
and report on the improvement in your readme and on your submitted
web page (see below).
Area Lights and Soft Shadows
Define a new tag for an area light where you specify its
position and shape as a quadrilateral in world coordinates. Cast
several shadow rays to random positions on the area to compute a
weighted lighting computation. Note that the number of rays you
cast should be configurable in the lamp definition, but you could
optionally optimize the number of rays you cast depending on the
distance between the light and the surface being lit.
Note that the bonus items listed below have been adjusted slightly,
and you can still implement extra features for extra credit.
Final Submission Format
You should create and submit a web page (that is the files, not
just a link!) along with your assignment submission which contains
images that demonstrate each requirement of the assignment, along
with demonstrating the extra features you implemented.
While you could probably create one image to show all of your
features at once, it is suggested that you take some time to create
a variety of nice test scenes and render several images. Some images
should be plain and simple to demonstrate individual features.
Other images should be more complex and demonstrate a creative use
of your software to generate interesting images.
Each image on your submitted web page should include a caption
that gives the name of the xml scene file you used to generate the
image, the computation time to generate the image, a list of
features demonstrated in the image, and any additional comments.
You may also want to list your hardware and operating system to help
give meaning to the timings for each image. Note that the images
should be a reasonable size, for instance, 640x480 is sufficient for
showing many of the features, but you may optionally want to compute
higher resolution images for your final scene, but do not go higher
Note that we may also run your code, but largely evaluation of
your assignment will be done by inspecting the web page and your
submitted code. Submitting an image that was not generated by your
code is considered cheating. Because raytracers may take a long time
to generate a given image the TAs may only selectively run specific
examples, and it is largely on your honor that the images you show
are yours (do not violate this trust).
There will be optional competition for images created with your
raytracer. You do not submit an image if you do not want to
To participate, you should submit a representative image, and a short
description describing the technical achievements and or artist
statement for your submission. Submit the image and statement to the
competition assignment box by the end of Monday 30 November.
A small jury will judge submissions based on aesthetics, creativity,
and technical merit. Winners will be announced in class on Tuesday 1
In this assignment, you will write a raytracer. Note that there
is no written part to this assignment. The sample
code will get you started with an XML scene file parser and code
to write PPM image file. The XML scene format is very very loosely
based off of the Yafaray format, but is simplified and modified for
the purpose of this assignment. You are free to make additional
modifications and extensions as you please to both the XML format
and the code, but your code should still work with the simple
examples provided, and likewise, any changes you make must be well
documented in your readme file.
XML scene description
The XML file is organized as sequence of named materials, lights,
cameras, nodes, and renders. The main scene is defined in the node
with the name "root". In general you will only need to have one
node defined, and it must have the name "root", but nodes can also
be referred to within the scene graph hierarchy as an instance
(i.e., to help you reuse parts of the scene hierarchy multiple
The scene nodes each have an associated transformation. The node
definition can contains a list of transformations (translation,
rotx, roty, rotz, and scale (and others if you choose to add them)).
These transformations are applied in order to build the node
transformation. The node can also list a number of different kinds
of geometry (sphere, cube, mesh, instance). Finally, the node can
also contain a list of child nodes, allowing a hierarchy of
transformations and geometry to be built.
Look at the two examples provided to get a better idea of how the
scene description files are organized. Please share your test
scenes on WebCT. Note that you may also implement additional tags
and attributes as you proceed through the objectives, so this may
A4App opens an xml document and calls the Scene constructor to load
the scene definition from the xml file. It then calls the scene
render method to produce an image file. This render method is a
good place to start making changes to the code, but you will need to
make lots of changes to many classes, and make new classes on your
own. You've been provided with basic classes for defining a
materials, lights, and nodes, but they do nothing but hold loaded
data. A Ray class and an intersection result have been defined for
your convenience, but you may wish to change them. They are defined
to allow the Intersectable interface to be defined. The sphere,
cube, plane, mesh, or any other geometry (or node) that can be
intersected will implement this interface.
Great! Be sure your name and student number is in the window
title, and in the comments of the code. Submit your source code
as a zip file via webCT.
Include a readme.txt file with your comments. DOUBLE CHECK your
submitted files by downloading them from WebCT. You can not
recieve any marks for assignments with missing or corrupt
Note that you are encouraged to discuss assignments with your
classmates, but not to the point of sharing code and answers.
All code must be your own.