Eevee: Fix tangent being renormalized after interpolation

This commit is contained in:
Clément Foucault 2019-03-15 22:24:46 +01:00
parent 66225e84cf
commit 1d6009d7aa
1 changed files with 2 additions and 3 deletions

View File

@ -2971,9 +2971,8 @@ void node_normal_map(vec4 tangent, vec3 normal, vec3 texnormal, out vec3 outnorm
outnormal = normal;
return;
}
float fsign = (gl_FrontFacing ? 1.0 : -1.0);
tangent.xyz = normalize(tangent.xyz) * fsign;
vec3 B = tangent.w * cross(normal, tangent.xyz) * fsign;
tangent *= (gl_FrontFacing ? 1.0 : -1.0);
vec3 B = tangent.w * cross(normal, tangent.xyz);
outnormal = texnormal.x * tangent.xyz + texnormal.y * B + texnormal.z * normal;
outnormal = normalize(outnormal);