CS 6620 Advanced Computer Graphics II - Assignment 10

Zach Gildersleeve
April 23, 2007

Required Image

There is no required image for this assignment.

Creative Image


Camera with f4.0 focused at 30, 25 samples per pixel and Gaussian filtering with a support of 3 pixels, rendered in 679 seconds.


Camera with f4.0 focused at 50, 25 samples per pixel and Gaussian filtering with a support of 3 pixels, rendered in 715 seconds.


Camera with f11.0 focused at 30, 25 samples per pixel and Gaussian filtering with a support of 3 pixels, rendered in 724 seconds.

The above images illustrates several Monte Carlo effects that were implemented for this assignment, specifically a ThinLensCamera and soft shadows courtesy of an AreaLight. The soft shadows were incorporated in the rendering contest image discussed below, but not the ThinLensCamera.

Code Listing

The code for this image can be found here.

Design Choices

Most of the time during this project was spent on the rendering contest image, so the Monte Carlo functionality is limited to was was needed for that image. The soft shadows are created by an Area light defined by three points (a position and two sides). During the AreaLight::getLight() function, the light's position is randomly determined across the defined rectangle. A random disc function was implemented (held in the Vector class) that returns a random value within a disc. This is used in the ThinLensCamera, which along with additional parameters of focal distance and aperture, allows for depth of field blurring. While the soft shadows do not require quite the per-pixel samples that the ThinLensCamera does, both techniques do require much more sampling and filtering to produce a quality image.

Extra Credit

The above images illustrate soft shadows and a thin lens camera, for extra credit 1.

For extra credit 2 (the rendering contest image), I added several key classes that allowed me to build the following image. A very simple .obj model reader was implemented that reads in only faces and normals. These faces are treated at triangles in SmoothTriangle using the normal data, which was previously implemented but never used. SmoothTriangle uses normal Vector's at each vertex, and then uses barycentric interpolation to generate the smooth normal. The .obj reader does not implement texture coordinates, and so relies on the default texture coordinates (such as seen with the bunny triangle mesh in previous assignments).

Most of the modeling was done in Maya and then exported as .obj files, for a total of 19 models. Some of these models were than instanced and transformed. For example, there is only one model for the vines, plates, bread, and parts of the lemons. The grapes, table, and armillary globe are all primitives, than are themselves often instanced. The Phong material class was expanded to pass in a pointer to a material which was then used as bump mapping.

The scene was rendered at 25 samples per pixel, using Gaussian filtering. This took essentially two days to render on my laptop, although the rendering was broken up into sections rather than doing the entire image all at once.

The high resolution version can be downloaded here (3.1MB)

Additional Comments

Obviously, the vast majority of the time on this project was spent on rendering. The actual Monte Carlo code, which is fairly limited, took about an hour to code and to render several images. The code for the .obj reader, bump map, and other classes implemented specifically for the render contest image took about 5-8 hours to complete, with much of that time spent rendering. The modeling, designing the materials, and arrangement of the objects took approximately another 5 hours, and several undersampled renders before the final rendering took about nine hours total.