[General boards] [Fall 2018 courses] [Summer 2018 courses] [Winter 2018 courses] [Older or newer terms]

Testing Blinn-Phong on A6?


#1

I have Lambertian Shading working:

Lambertian

But Blinn-Phong is giving me trouble. I’ve executed all four colour debugging tests detailed in the README, and all four work correctly. My only hint is that when I set p to a very small (1-3) number, the wrong (facing away from the light) hemisphere of the spheres turns grey.

Is there any other sanity tests I can do to debug the code? I’ve checked and double checked that the normal and light vectors are working (as evidenced by the Lambertian shading working), and I’m wondering if there’s any extra considerations to be made for the view vector. I’m using a directional light if that helps.


#2

Was able to solve it today.

It seems like length(x) and normalize(x) act in unexpected ways, after replacing all these with manual operations in my code it worked.