Jeremiah Darais

Assignment 2

Image Result

screenshot

Source Code

Design Choices

To calculate the attenuation level of a color, I take the maximum of the three components. The attenuation is passed down the ray tree as a color, and only converted to a double value for comparison to the minimum attenuation value for the scene.

For Beer's attenuation, rather than multiplying the color from a raycast by the Beer's attenuation value at the source of the raycast, I apply it wherever the ray hits before returning the color. I did this since the distance traveled to the intersection point is already in the hit-record as the t value. This changes the algorithm from the pseudocode in the slide so that if a ray is exiting the object, whatever color is accumulated (reflected and refracted) for that ray is multiplied by the beers attenuation value for the distance travelled for that ray. If the ray is entering the object, no Beer's attenuation is applied to any color from secondary rays.

I had originally used the reflected view vector to calculate the specular component, but then changed to using the half-angle vector when I heard that it was the preferred way of doing things. In this assignment, though, I seem to like the look of the reflected-view-vector method on the metal material more than the half-angle-vector method. It gives sharper highlights, which seems to me to be more characteristic of a reflective surface, and creates that crescent-shaped highlight on the metal ball in the scene for this assignment, which I prefer over the look of the highlight produced from the half-angle-vector method.