[Bf-blender-cvs] [f6a6770f06e] master: Fix T62839 object scale changes normal map output in eevee

Clément Foucault noreply at git.blender.org
Fri Mar 22 14:30:47 CET 2019


Commit: f6a6770f06ee8811493123cc8f66b0753c74a2f8
Author: Clément Foucault
Date:   Fri Mar 22 14:30:37 2019 +0100
Branches: master
https://developer.blender.org/rBf6a6770f06ee8811493123cc8f66b0753c74a2f8

Fix T62839 object scale changes normal map output in eevee

Was using the wrong vector length.

===================================================================

M	source/blender/gpu/intern/gpu_codegen.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 99b79d3758c..433f8b909c2 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -1008,8 +1008,8 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u
 					        input->attr_id, use_geom ? "g" : "", input->attr_id);
 					/* Normalize only if vector is not null. */
 					BLI_dynstr_appendf(
-					        ds, "\tfloat lvar%d = dot(att%d.xyz, att%d.xyz);\n",
-					        input->attr_id, input->attr_id, input->attr_id);
+					        ds, "\tfloat lvar%d = dot(var%d%s.xyz, var%d%s.xyz);\n",
+					        input->attr_id, input->attr_id, use_geom ? "g" : "", input->attr_id, use_geom ? "g" : "");
 					BLI_dynstr_appendf(
 					        ds, "\tvar%d%s.xyz *= (lvar%d > 0.0) ? inversesqrt(lvar%d) : 1.0;\n",
 					        input->attr_id, use_geom ? "g" : "", input->attr_id, input->attr_id);



More information about the Bf-blender-cvs mailing list