Assignment 3 Camera Simulation

Kurt Berglund

Date submitted: 9 May 2006

Code emailed: 9 May 2006

Compound Lens Simulator

Description of implementation approach and comments

To represent the camera's lens stack, I created a new Lens class for each lens within the stack. A lens simply stores a reference to a pbrt shape primitive which represents the geometry of the lens, as well as some other basic information relating to the lens (indices of refraction, radius). A sphere with its bounds clipped is used for the actual lenses, while a disk with a diameter equal to the passed in camera's aperture size is used to represent the camera's aperture. To find an outgoing ray then, the incoming ray is traced through the stack of lenses. When an intersection occurs the refracted ray is computed and the process continues until either the ray exits the camera, or it no longer intersects with a lens, or total internal refraction occurs.


To compute the ray to trace through the lens stack I compute the sample's imageX and imageY positions to a point on the film plane. Then I pass lensU and lensV to ConcentricSampleDisk to compute a point on a disk with the same radius as the back lens position that is located at the same z position as the back lens element. The weight for this ray then is equal to (area of the disk being sampled) * (cosine between the ray direction and the positive z axis (since this points towards the lens))4 / (distance from the back lens to the film)2. This weighting follows from the integral described in the paper and the sampling method being used. In the case that the ray does not exit the camera, the weight value returned is 0.


One other issue I ran in to was with with the alpha variable in pbrt's scene render. As I found while debugging, in the case of a 0 weight, this value is uninitalized and is subsequently used by pbrt. In the end, I ended up setting its value to 1, since in the case of the camera, a ray weight of 0 is a ray which hit the inside of the lens, and so should be treated as a black ray.

Final Images Rendered with 512 samples per pixel

My Implementation

Reference

Telephoto

blank300x300

hw3telephoto_512

Double Gausss

blank300x300

hw3dgauss_512

Wide Angle

blank300x300

hw3wide_512

Fisheye

blank300x300

hw3fisheye_512

Final Images Rendered with 4 samples per pixel

My Implementation

Reference

Telephoto

blank300x300

hw3telephoto_4

Double Gausss

blank300x300

hw3dgauss_4

Wide Angle

blank300x300

hw3wide_4

Fisheye

blank300x300

hw3fisheye_4

Experiment with Exposure

Image with aperture full open

Image with half radius aperture

blank300x300

blank300x300

Observation and Explanation

......

Autofocus Simulation

Description of implementation approach and comments

......

Final Images Rendered with 512 samples per pixel

Adjusted film distance

My Implementation

Reference

Double Gausss 1

mm

blank300x300

hw3afdgauss_closeup

Double Gausss 2

mm

blank300x300

hw3afdgauss_bg

Telephoto

mm

blank300x300

hw3aftelephoto

Any Extras

...... Go ahead and drop in any other cool images you created here .....

KurtBerglund/Assignment3 (last edited 2006-05-10 05:17:01 by KurtBerglund)