CS 447/647: Image Synthesis

Assignment 3: Simulating a realistic camera

Due: (1) February 20, (2) February 27, (3) March 11

Description

Many rendering systems (including lrt) approximate irradiance on the film plane by sampling scene radiance through an infinitesimal aperture (i.e a pin-hole) or by using a thin lens approximation. Unfortunately, these techniques are geometrically and radiometrically incorrect and can therefore 'lay to waste' much of the physically accurate computation involved in realistic image synthesis. A realistic camera model can accurately compute film irradiance by tracing sample rays through a multi-lens system, correctly revealing effects such as depth of field, vignetting and film exposure.

Your ultimate goal in this assignment is to add a physically-based camera class to lrt and generate images corresponding to different camera input parameters. We have divided the workload into three smaller assignments designed to expose (and compel you to deal with) any logistic or conceptual hurdles along the way.

The three parts to this assignments are as follows (details for each can be found below):

Prerequisites

Read the paper entitled A Realistic Camera Model for Computer graphics. Not only is this work the inspiration for this assignment but it covers useful details not presented here (and if nothing else might compel you to hunt down some mathematically rigorous multi-lens analysis). You can probably answer many of your questions by reading this paper carefully.

Part (1), Due: February 20

The purpose of part (1) in this assignment is to get you comfortable with the lens specification format, the process of tracing rays through a multi-lens system (simple refraction), and a particular method for calculating the position of principal planes.

Your OpenGL-based application should be able to take a single command-line argument - that is, the path to a lens system specification. Each lens spec is tab delimited, where each row corresponds to a specific lens (or aperture) interface in the system. A description of each column label is as follows (and can be found in the paper):

After parsing this file, you should use the information to render a 2D outline drawing of the lens system, including the aperture stop. (Note that the for rows defining an aperture, the only needed values are the position and aperture size - so naturally the radius is zero). Next you want to calculate the location of each of the principal planes. These planes will be used in part (2) for rendering the scene with a thick lens approximation. The principal planes can be located using a set of refraction matrices but it's much easier (and more accurate as you'll read) to trace rays through the lens system from both directions and determine the location of the planes this way. This is described in the paper. After finding these planes you should render them as the final touch to your 2D diagram. Details of this application not specified here (initial window size, background color, etc) are up to you.  Do something reasonable.

Note: Your GL application should be completely independent from lrt. While you are free to use code from the book (for refraction, etc.), you might find it easier to implement, for example, a simple refraction routine on your own.

You can download test lens files here. The file is tab delimited so make sure your parser can handle this.

Submission

For this first part of the assignment, you a free to program GL in either Linux or Windows. However, please use Glut or FLTK for generating a GUI.

Write a short web page describing your implementation.  The web page should consist of:

Then, just mail the URL to the TA and include Assigment 3, part 1 in the subject

When submitting assignments, NEVER mail the TA anything other than a URL.

Grading

This homework will be graded according to the following system:

0 - Little or no work was done
* - Significant effort was put into the assignment but the rendering is incorrect..
** - You are able to parse and render the lens system, but the principal planes are wrong.
*** - All requirements satisfied.

Part (2), Due: February 28

For this part of the assignment you will start by extending you OpenGL application to calculate the exit pupil for a given lens system. The exit pupil is defined as the apparent size and location of the aperture in image space and can be determined by imaging the aperture through the portion of the lens system between the aperture and image plane. For this step you will need to calculate and render the principal planes for portion of the lens system between the aperture and film. Add to your 2D rendering the exit pupil and the sub-system principal planes.

Next you will extend the methods you developed in part (1) to 3D by adding a realistic camera class to lrt. You can find skeleton code for such a class along with a test rib file here. You can just add the Makefile.filelist and realistic.cc files to your version of lrt, or download the tarball. For this part of the assignment, your goal is to render an image that uses a thick lens approximation to any lens system. As discussed in the paper, this can be accomplished by simply translating camera rays between principal planes. Be sure that your implementation handles vignetting properly. Also, in order to achieve correct exposure you must fire rays at the exit pupil instead of targeting the physical aperture. However, for now just fire rays at the rear most lens interface (i.e use this as the sample space). This will waste many sample rays but will give the correct image. Lrt has tools for concentric disk sampling, so you don't have to implement these routines yourself. (Check the code for the perspective camera for an example of how to sample a disk).

Lens specification files will now be defined as a parameter/value pair in the rib file given above. You will need to add values for the "specfile," "focaldistance," and "fstop" parameters. An example can be found in the rib file. You can render images with lrt decls.rib dof.rib. Remove the comment on the perspective camera to see how the scene should render.

Submission

Your software must run on linux for this part of the assignment.

Write a short web page describing your implementation.  The web page should consist of:

Grading

This homework will be graded according to the following system:

0 - Little or no work was done
* - Significant effort was put in but neither the GL app or the camera class function properly.
** - You are able to make the necessary extensions to your GL application but the camera class doesn't function with lrt (i.e, no image).
*** - All requirements satisfied.

Part (3), Due: March 13

For the final part of this assignment you will extend your realistic camera model to include accurate raytracing of the entire lens system. While in part (2) you were only expected to fire rays at the rear lens element, now you must use the location of the exit pupil to generate only rays that will pass through the aperture. This should be a straight forward addition to your model.

You must verify your realistic camera implementation by producing the following renderings. In all cases, use the test scene from part 2:

Submission

Your software must run on linux for this part of the assignment.

Write a short web page describing your implementation. You only have to provide the highlights. Include all of the images listed above and label them accordingly.

Email the TA a link to your assignment web page.

Grading

This homework will be graded according to the following system:

0 - Little or no work was done
* - Significant effort was put into the assignment but you are unable to trace the entire lens system.
[**, ***, ****] - These correspond to the number of steps 2-4 you complete successfully.