Revision 3 as of 2007-04-25 05:25:50

    Assignment3

Assignment 3: Camera Simulation

Due: Friday May 8th, 11:59PM

Please add a link to your final writeup on Assignment3Writeups.

lenses

Description

Many rendering systems approximate the light arriving on a virtual camera's film plane by assuming the camera is a pin-hole camera. In contrast, real cameras contain multi-lens assemblies with different imaging characteristics such as limited depth of field, field distortion, vignetting and spatially varying exposure. In this assignment, you'll extend pbrt with support for a more realistic camera model that accurately simulates these effects. Specifically, we will provide you with data describing real wide-angle, normal and telephoto lenses, each composed of multiple lens elements. You will build a camera plugin for pbrt that simulates the traversal of light through these lens assemblies. With this camera simulator, you'll explore the effects of focus, aperture and exposure. Once you have a working camera simulator, you will add simple auto-focus capabilities to your camera.

Step 1: Background Reading

Before beginning this assignment you should read the paper "A Realistic Camera Model for Computer Graphics" by Kolb, Mitchell, and Hanrahan. This paper is one of the assigned course readings.

Step 2: Getting Up and Running

Starter code and data files for Assignment 3 are located at http://graphics.stanford.edu/courses/cs348b-07/assignment3/assignment3.zip.

Step 3: Setup the Camera

Notice that the pbrt files for assignment 3 specify that rendering should use the "realistic" camera plugin that you are implementing in this assignment. The realistic camera accepts a number of parameters from the pbrt scene file. The most important of these parameters include: the name of a lens data file, the distance between the film plane and the location of the back lens element (the one closest to the film), the diameter of the aperture stop, and the length of the film diagonal (distance from top left corner to bottom right corder of film). The values of these parameters are passed in to the constructor of the RealisticCamera class. All values in both the pbrt file and in the lens data file are in units of millimeters.

Camera "realistic" 
        "string specfile" "dgauss.50mm.dat" 
        "float filmdistance" 36.77
        "float aperture_diameter" 17.1
        "float filmdiag" 70 

The .dat files included with the starter code describe camera lenses using the format described in Figure 1 of the Kolb paper. In pbrt, the viewing direction is the positive z-direction in camera space. Therefore, your camera should be looking directly down the z-axis. The front of the first lens element (the lens element closest to the world, and farthest from the film plane) should be located at the origin in camera space with the rest of the lens system and film plane extending in the negative-z direction.

Each line in the file contains the following information about one spherical lens interface.

lens_radius  z-axis_intercept  index_of_refraction  aperture

More precisely:

  • lens_radius: is the spherical radius of the element.

  • z_axis_intercept: is thickness of the element. That is, it's the distance along the z-axis (in the negative direction) that seperates this element from the next.

  • index of refraction: is the index of refraction on the camera side of the interface.

  • aperture: is the aperture of the interface (rays that hit the interface farther than this distance from the origin don't make it through the lens element)

Note that exactly one of the lines in the data file will have lens_radius = 0. This is the aperture stop of the camera. It's maximum size is given by the aperture value on this line. It's actual size is specified as a parameter to the realistic camera via the pbrt scene file. Also note that the index of refraction of the world side of the first lens element is 1 (it's air).

Step 4: Generate Rays

  • You now need to implement the RealisticCamera::GenerateRay function. GenerateRay takes a sample position in image space (given by sample.imageX and sample.imageY) as an argument and should return a random ray from the camera out into the scene.

    • sample.imageX and sample.imageY determine the position on the film plane this ray should originate from

    • The color of a pixel in the image produced by pbrt is proportional to the irradiance incident from the world onto a single pixel of the film (think of the film as a sensor in a digital camera). This is an estimate of all light reaching this pixel from all paths through the lens. Therefore, computing this estimate involves drawing samples from all of these paths. The easiest way to sample all paths is to fire rays at the back element of the lens. Note that some of these rays will hit the aperture stop and terminate before exiting the front of the lens.

Hints

1.

Step N: Submission

  • We've created wiki pages (FirstnameLastname/Assignment3) for all students in the class. Access to these pages is set up so that only you can view your page. Please compose your writeup on this page and link to it from the Assignment3Writeups page.

  • Foo Note that you can link to the images to display them on your wikipage using attachment:filename.

  • Bar

Grading

This assignment will be graded on a 4 point scale:

  • 1 point:
  • 2 points:
  • 3 points:
  • 4 points:
Recent