Fix T61380 Geometry normal node incorrect for backfacing faces in Eevee

This commit is contained in:
Clément Foucault 2019-03-12 18:49:02 +01:00
parent e37e105fed
commit f16bdf1075
Notes: blender-bot 2023-02-14 08:42:54 +01:00
Referenced by issue #61380, Geometry normal node incorrect for backfacing faces in Eevee
1 changed files with 2 additions and 3 deletions

View File

@ -1780,7 +1780,7 @@ void node_tangentmap(vec4 attr_tangent, mat4 toworld, out vec3 tangent)
void node_tangent(vec3 N, vec3 orco, mat4 objmat, mat4 toworld, out vec3 T)
{
#ifndef VOLUMETRICS
N = normalize(worldNormal);
N = normalize(gl_FrontFacing ? worldNormal : -worldNormal);
#else
N = (toworld * vec4(N, 0.0)).xyz;
#endif
@ -1809,8 +1809,7 @@ void node_geometry(
position = worldPosition;
# ifndef VOLUMETRICS
normal = normalize(worldNormal);
normal = normalize(gl_FrontFacing ? worldNormal : -worldNormal);
vec3 B = dFdx(worldPosition);
vec3 T = dFdy(worldPosition);
true_normal = normalize(cross(B, T));