   Normal problem in glsl
  I've implemented tangent space normal mapping in GLSL.But I'm having a problem, when I rotate/move the camera the shading also moves around, and shouldnt.In the vertex shadervec3 n = normalize(gl_NormalMatrix * gl_Normal);vec3 t = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz);vec3 b = normalize(cross(n, t) * gl_MultiTexCoord2.w);mat3 tbnMatrix = mat3(t.x, b.x, n.x, t.y, b.y, n.y, t.z, b.z, n.z);In the fragment shadervec3 n = normalize(texture2D(normalMap, texCoord).xyz * 2.0 - 1.0);nDotL = clamp(dot(n, l));What I'm doing wrong?   
  I have no idea about tangent space algorithms, but this line looks odd to me:vec3 b = normalize(cross(n, t) * gl_MultiTexCoord2.w);Are you multiplying a vector by a scalar, and then normalizing it? What is the purpose of that multiplication if you normalize it afterward? Are you sure you have your parenthesis right?   ;  Hmm, that .w component just contains either 1 or -1, so I think the result is the same either I multiply it before or after normalization.The problem I think is in the normal vector, gl_NormalMatrix seems to contain the transformation of camera + model transform, so the normal is dependent on both, and should only be on the model transform, I'll try to pass it as matrix uniform.   