For this project I worked to add motion blur and depth of field to the raytracer that I had been working on throughout the quarter. In order to add the motion blur, I added an additional vector to the objects being passed in. This vectors specifies the direction and intensity of the blur, which is then created by adding a randomized value along that vector while determining ray intersections. In regards to adding depth of field, I added an aperture value to the command line argument of the renderer to determine its intensity. I then modified my raytracer to cast rays from randomized points in the area around the initial camera position, with he size of this area being determined by the aperture. This creates a greater blurring effect in the areas away from the focal point depending on the aperture strength. I decided to use my motion blur to create an image of a shooting star above the earth. While it isn't hyper realistic by any means, the effect can be seen in the pictures below, particularly the first picture. The second picture shows the image while making use of the depth of field feature, blurring the image and focusing in on the earth itself. The following 3 images are to display the DoF effect more clearly. They all use an equivalent aperture, with a different focal length for each. The first is focused towards a distance close to the center sphere, the second at a distance farther, and thus showing the distant spheres more closely, and the third is focused towards a distance closer to the camera, making the closer spheres less blurry. I found this raytracer to be a challenging, but rewarding project. It has many bugs, and I wasn't able to fix everything that I wanted, but I was able to catch a number of bugs in the final stretch, all while adding in the motion blur and depth of field features.
Images of Renders