slightly better way of fixing planet render problem when rolling ship

This commit is contained in:
Kevin Anthoney 2014-02-07 20:47:55 +00:00
parent b6c3541ea3
commit 7c7a004038
2 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ void main()
#else
vec4 normalMapSample = texture2D(uNormalMap, texCoords);
#endif
vec3 normal = normalize(normalMapSample.xyz - vec3(0.5)) * vTBN;
vec3 normal = vTBN * normalize(normalMapSample.xyz - vec3(0.5));
#else
vec3 normal = vNormal;
#endif

View File

@ -37,7 +37,7 @@ void main(void)
vec3 binormal = cross(vNormal, gl_NormalMatrix * vec3(0, 1, 0));
vec3 tangent = -cross(vNormal, binormal);
vTBN = transpose(mat3(tangent, binormal, vNormal));
vTBN = mat3(tangent, binormal, vNormal);
vEyeVector = -vec3(gl_ModelViewMatrix * gl_Vertex);