Spring 2006 Gallery
Spring 2005 Gallery
Spring 2004 Gallery
Spring 2003 Gallery
Spring 2002 Gallery
Spring 2001 GalleryAugment the ray tracer you wrote for MP1 to support depth of field using distributed ray tracing. Your ray tracer's input should include a focal distance which indicates the distance from the viewpoint to the focal plane (the plane where everything is in focus), and an aperture, which is the diameter of the disk from which rays are cast into the scene. Both parameters should be specified in world coordinate units.
These units correspond to a real camera's depth of field. In this case, the diameter of the aperture is given by the focal length of the lens divided by the f-stop. For example, if you have a focal length of 35mm, and your f-stop is set to 2, then your aperture (diameter of the disk of ray origins) would be 17.5mm. This setting usually exaggerates the depth of field effect, especially for objects near the camera. If you instead set your f-stop to 16, then your aperture would be only about 2mm, which would yield a hardly perceptible depth of field effect for typical scene distances from the camera. (When photographing, the f-stop also affects the exposure necessary, which controls the amount of light that reaches the film. Graphics liberates us from the confines of physical film media, even though we as a field seem to enjoy simulating this medium as closely as possible. In any case, the aperture of your distributed ray tracer can control depth of field without worrying about exposure.)
To disguise aliasing artifacts as noise, you should jitter your samples in the lens plane. An easy mistake in computer graphics is to accidentally bias statistical samples. In this case if one used polar coordinates with a random radius and angle, the resulting jitter would be biased toward the center of the disk. A better technique for uniformly sampling points in a disk is to pick random points in a bounding square, and throw out choices if they fall outside of the disk.
You should also jitter your screen samples using the uniform jitter technique that randomly places samples in a subdivided grid on each pixel. Note that this does not mean that you need 16^2 = 256 samples per pixel. Only 16 samples are needed because each sample can be simultaneously jittered in the image plane for antialiasing and in the lens plane for depth of field.
You should use at least 16 samples per pixel, though I will allow fewer samples if an adaptive sampling scheme is implemented. Adaptive sampling is not required for this assignment. Depending on the severity of the depth of field effect, you will likely need more than 16 samples per pixel to avoid graininess in the resulting picture.
Create a scene that highlights the use of depth of field for a dramatic effect. Your program should compile and run automatically, out of the box, on either the PC or Unix Workstations in one of the labs used for this class. The program is due:
The late penalty is 10% per day with a maximum of 5 days late.
Others have suggested that the focal plane should actually be a focal sphere around the eyepoint. This might be an interesting effect but is not realistic. The reason we use a plane is that a real camera uses its lens to focus light onto film. Since the film is flat (planar), its focal image in the world is also planar. Note that some compound fisheye lenses can produce a "barrel" distortion, but setting up such a lens system is beyond the scope of this class.