Assignment 3 Camera Simulation

Hyun Gu Lee

Date submitted: ?? May 2006

Code emailed: ?? May 2006

Compound Lens Simulator

Description of implementation approach and comments

It is said that one does not feel the passage of time when one engages in an activity that is enjoyable. I, for some reason, did not feel the passage of time while working on this assignment :-? . While I won't go into every little mistake that has kept me from finishing this, I will give a broad overview of what I did.

First, off in the camera constructor, I build and store the data structure for the lens surfaces. I also calculate useful variables here such as total thickness of all lenses, length of each side of the film, and Area of back lens over film distance squared.

In GenerateRay, I find convert the given imageX and imageY coordinates from raster to camera coordinates. After calling ConcentricSampleDisk, I compute the camera coordinates of the sampled point on the back lens. By using these two points, I get the initial ray direction and origin. It is "important" to remember to normalize this initial ray direction if vector form of Snell's law is used later on.

The ray then goes through each lens surface. If the current surface is actually a aperture stop, a ray-plane intersection is performed. The distance from the intersection point to the z-axis is computed. If this is larger than the given aperture, this ray is blocked, so we return. For other lens surfaces, the intersection is computed using ray-sphere intersection. This code is heavily borrowed from pbrt. After the intersection point is computed, its distance from the z-axis is compared to the aperture. Again, if the ray is outside the aperture of the lens, we return. Now, we compute the new ray direction using the vector form of Snell's law. (Much easier to use!). We check for internal reflection, then continue with the loop.

After we're done going through all the lens surfaces, the ray is converted to World coordinates. We do some housekeeping with various ray members, then compute the weight for irradiance calculation.

I've also coded up a ray visualization during my hours of frustration. It wasn't very helpful because of the nature of my bugs/stupidity :-? I wrote it using OpenGL, modifying some test code I wrote for some other project.

{i} CLICK HERE TO ENLARGE

Final Images Rendered with 512 samples per pixel

My Implementation

Reference

Telephoto

hw3telephoto_512

Double Gausss

hw3dgauss_512

Wide Angle

hw3wide_512

Fisheye

hw3fisheye_512

Final Images Rendered with 4 samples per pixel

My Implementation

Reference

Telephoto

hw3telephoto_4

Double Gausss

hw3dgauss_4

Wide Angle

hw3wide_4

Fisheye

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