I am currently experiencing a very obvious artifact that only occur when I use normal maps. However it only occurs when looking at surfaces on very grazing angles.
I will also post the vertex and fragment shader code for unpacking normals maps:
Vertex Shader Snippet:
vec3 T = normalize(normalMatrix * tangent); vec3 B = normalize(normalMatrix * bitangent); vec3 N = normalize(normalMatrix * normal); TBN = mat3(T, B, N);
Fragment Shader Snippet:
vec3 normal = texture(material.texture_normal, TexCoords).rgb; normal = normalize(normal * 2.0f - 1.0f); normal = normalize(TBN * normal);
I would really appreciate if anyone has ever experiences this kind of artifact. Is it my BRDF, is it my normal calculations? I am not sure.. I would appreciate any insight people have!
If you want to see my fragment shader and my BRDF you can find the code here: