I have checked and double checked my lighting equation many times with at least 3 different sources. At the moment I am using constant lighting coefficient so that I know for a fact my object will be lit no matter what the distance. My light is EXPLICITLY fixed at the -30.0 position on the Z-axis, yet my object appears as if it is lit from a different direction. My camera is located at ( 0.0, 0.0, -20.0 ) so that I can verify the model is not swallowing the light, and it is not. The light is plenty far away from my model. I've changed the light/camera distance many times and have gotten the same result.
The entire front side of my object should be lit, instead it is lit from a different angle.
I use the DirectXMath library and I was VERY, VERY careful to store the const buffer matrices correctly and with the right alignment. I also made sure my HLSL byte alignment was correct by using float4. I use the row-major compiler options for HLSL so I do not need to use matrix transpose, and my code reflects that.
Please give my code a look and tell me where I've gone wrong, because I obviously cannot figure it out!
Matrix update function:
Edited by eowdaoc, 08 December 2012 - 08:15 PM.