Assignment 3 Camera Simulation

Tom Brow

Date submitted: 10 May 2006

Code emailed: 10 May 2006

Compound Lens Simulator

Description of implementation approach and comments

I represent the compound lens using a linked list of lens structs, each of which contains information about one lens surface or aperture stop. The surface of the element is represented as a pbrt Shape -- a Sphere for a lens surface, and a Disk for a stop -- and precomputed values for the refractive index ratio across the surface (i.e. n1/n2) and the cosine of the critical angle are stored as well. The compound lens structure also stores a Transform from camera space to lens space (and vice versa) so that the construction and intersection of lenses can all be done in lens space.

To generate a ray, the camera samples the aperture of the back element, then traverses the linked list of elements, applying the vector form of Snell's Law (source: Wikipedia) at each surface. The ray is terminated and returned with weight 0 if it either (a) fails to intersect or (b) is totally internally reflected from any surface. Otherwise, the modified ray is returned with the weight given by (A/Z2)cos(theta)4, where A is the area of the aperture of the back element, Z is the distance from the film plane to the back lens, and theta is the angle between the original, unmodified ray and the normal to the film plane (source: Kolb).

While testing by compund lens implementation, I found it useful to visualize the path of rays traveling through the lens. However, it would have been difficult to render the lenses and rays directly with a good deal of extra work. Instead, I had my program output every intersection that occurred inside the lens during ray tracing as sets of 3D coordinates, grouped by ray. Plotting these points in 2D and 3D space using gnuplot, I could visualize lens surfaces as clusters of intersections, and trace lines through groups of intersections to simulate rays. The 2D plots look like this: [plot1.png], Upload new attachment "plot1.png", Upload new attachment "plot1.png", Upload new attachment "plot1.png".

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 .....

TomBrow/Assignment3 (last edited 2006-05-12 06:19:18 by TomBrow)