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)

enter image description here

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.)

enter image description here

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.

  • \$\begingroup\$ I don't see you taking the camera position (or view direction for that matter) into account at all in your fresnel calculation \$\endgroup\$
    – Athos vk
    Mar 17, 2016 at 8:30
  • \$\begingroup\$ That is correct. This is because the algorithm doesn't say anything about camera position or view direction. Am I missing something in the algorithm? \$\endgroup\$
    – Richmar1
    Mar 17, 2016 at 8:45
  • \$\begingroup\$ Wikipedia as well as the original paper are somewhat confusingly written from modern CG perspective. What's meant there is the dot product between surface normal and the direction from surface point towards viewer. And that's not the whole specular term, just one of the factors to be multiplied together in certain lighting (reflectance) models. \$\endgroup\$
    – snake5
    Mar 17, 2016 at 9:08
  • \$\begingroup\$ Thanks @snake5. however. according to Wikipedia theta is the angle between the direction from which the incident light is coming and the normal of the interface between the two media, hence cos(theta)=(dot(N,V)) ^^Wikipedia contradicts it'self in that statement. First it says that theta is the angle between light and normal, then says theta is the angle between normal and view. Can you show me how the Schlick algorithm should be by modifying my Schlick function in the OP. Thanks. \$\endgroup\$
    – Richmar1
    Mar 17, 2016 at 9:18
  • \$\begingroup\$ Did you read the last paragraph as well? Also, this might help regarding the implementation: filmicgames.com/archives/557 \$\endgroup\$
    – snake5
    Mar 17, 2016 at 9:43

1 Answer 1


The problem was that my Vertex Positions GBuffer Texture was being clamped to values between [0,1]. Converting the texture to Float32 format solved the issue. Thanks guys.

  • \$\begingroup\$ Nice to see that someone returns back with an answer to their problem! \$\endgroup\$
    – user35344
    Sep 18, 2016 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .