EEVEE: Geometry info -> tangent: Make consistent with Cycles for hair

Changes output for geometry info node in Eevee to be consistent with Cycles (w/o osl)

Before this patch Eevee outputs Z-tangent even for hair. This patch changes it to output hair tangent (growth direction). Hair tangent is impossible to derive otherwise from normal or view direction.

Reviewed By: fclem, brecht
Differential Revision: https://developer.blender.org/D10841
This commit is contained in:
Mikhail Matrosov
2021-05-19 12:09:29 +02:00
committed by Clément Foucault
parent 5239198f17
commit a294670bac

View File

@@ -37,8 +37,13 @@ void node_geometry(vec3 I,
normal = (toworld * vec4(N, 0.0)).xyz;
true_normal = normal;
# endif
# ifdef HAIR_SHADER
tangent = -hairTangent;
# else
tangent_orco_z(orco, orco);
node_tangent(N, orco, objmat, tangent);
# endif
parametric = vec3(barycentric, 0.0);
backfacing = (gl_FrontFacing) ? 0.0 : 1.0;