Project 2

Shading

OpenGL View

Ray tracer MK3, now in color!

Ray Traced View

Using the Blinn-Phong Shading Model

Z Buffer

Phong Shading

Pure phong calculates specular slightly differently. Note that I don't account for the differences in the size of the specular lobes between phong and blinn-phong.

Normals

Very handy for debugging.

Bugs

I forgot to verify the dot product between the light and the surface normal was greater than 1. Adding negative colors resulted in incorrect white patches.

Extra sneaky bugs!

I forgot to recursively bring the surface normal from model space to parent space in the scene graph. This messed up the orientation of my normals, which in turn messed up my shading. The fix was to recursively invert the normals from model space to their respective parent spaces.

Timing

0:00:00

Hardware

Intel HD Graphics 620, Intel Core i7 - 7500U CPU @ 2.7GHz, 16GB of memory