Fixed more issues. Diffuse light and ambient light seem to be working perfectly. Specular probably is, but it's harder to know for sure. Fails if multiple spheres are rendered: probably a looping issue in the collision detector. Investigating.