I read somewhere that ray tracing was addictive - it sure was. Making pretty things is really fun...I added antialiasing, soft shadows, depth of field, and refraction to my program. In the interest of time, I did cut some corners (i.e. the DOF effect does not model a lens system), but the results looked close enough. The render time with all the features turned on was also rather hideous, so I'm sure there are some optimizations I missed. Hopefully I will find time in the future to make it more robust!
This was done with distributed ray tracing. I treated each pixel as a grid of 4x4 subpixels and set the pixel color as the average of the colors of the rays traced through each subpixel. The results looked fine without jittering. As expected, this dramatically increased rendering time since it's the simplest and most inefficient way to do antialiasing.
This was also done with distributed ray tracing. Instead of modeling the light source as a point, I modeled it as a sphere. The lighting of a surface point is the average of the lighting from 100 individual rays cast from the point to random positions on the sphere. Because the light now has area, these rays will go in slightly different directions; some may be occluded while others are not. The ratio of rays occluded to rays unnoccluded indicates how bright the surface point should be.
To achieve DOF, for each pixel, I sent a 25 jittered rays starting near the camera position to the same point at some focal length in the scene. If these rays are intersected before they hit their target point, they will not have converged, so their averaged color will result in blurring. Otherwise, they will all return the same color, which will remain the same when averaged, so the scene at that pixel remains sharp.
This was a fun one. For every ray, instead of only tracing reflected rays, I also traced refracted rays. This was actually pretty easy; it just involved calculating the refracted ray (using Snell's law), and then adding a recursive call for the refracted ray in addition to the reflected ray. I simply added the refracted colors on top of the reflected colors. Realistically, the ratio of reflectance to refraction should depend on the source ray's angle of incidence (see Fresnel's equations), but the math involved is pretty complicated.