[Bf-blender-cvs] [a294670bacb] blender-v2.93-release: EEVEE: Geometry info -> tangent: Make consistent with Cycles for hair
Mikhail Matrosov
noreply at git.blender.org
Wed May 19 12:17:06 CEST 2021
Commit: a294670bacb1db66ca0aad29df5752b10b8ba7fd
Author: Mikhail Matrosov
Date: Wed May 19 12:09:29 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBa294670bacb1db66ca0aad29df5752b10b8ba7fd
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
===================================================================
M source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
===================================================================
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
index 4db27c3049d..a14ff5021bf 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
@@ -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;
More information about the Bf-blender-cvs
mailing list