I ve been trying to duplicate a normal mapping technique from what I already have in my ffp:
It does pretty much the same logic afaics and I get the same result but when I move the camera around the shading becomes darker, which is not good! Note that I m not adding light computation for simplicity sake.
Here is an hybrid code:
vec3 l_bumpMap = texture2D(u_BumpMap, v_TexCoord.st).rgb; vec3 l_lightVector = l_lightPosition â€“ vec3(gl_ModelViewMatrix * gl_Vertex); mat3 l_matrix = mat3(v_Tangent, v_BiTangent, v_Normal); vec3 l_direction = normalize(l_matrix * l_lightVector); vec3 l_bumpMap = dot(l_bumpMap, l_direction); gl_FragColor = vec4(l_bumpMap, 1.0);
what do I need here to compensate the camera orientation? And why is it different from the ffp?