I hope you are all doing ok. I have an issue with my Fresnel shader that doesn't allow the Fresnel to change as my camera moves around. I'm not sure what i'm doing wrong. I'm using glsl with the Schlick Fresnel algorithm along with a Diffuse BRDF. A picture says a thousand words, so let me show you the issue I am having. For debugging purposes, I am only rendering the Fresnel, nothing else.
The following image shows the Fresnel working perfectly from this particular angle (i'm looking along the direction the light is facing)
However, the following image shows the Fresnel not working when I pan the camera around the object to arrive at it's back (facing more or less against the light direction.)
As you can see, the Fresnel didn't change at all when i moved the camera, It's as if it's "Baked" into the object.
The code for the Schlick algorithm used in this application is:
vec3 Specular_Fresnel_Schlick( in vec3 SpecularColor, in vec3 PixelNormal, in vec3 LightDir )
{
float NdotL = max( 0, dot( PixelNormal, LightDir ) );
return SpecularColor + ( 1 - SpecularColor ) * pow( ( 1 - NdotL ), 5 );
}
All calculations are done in world space.
Any help you can provide would be a huge deal. Thank you for your time.