Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-03-22 16:30:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-03-22 16:30:43 +0300
commitf6a6770f06ee8811493123cc8f66b0753c74a2f8 (patch)
tree4d5cfb1167f242c9cbaeeab3555b4258374a8b6c
parentb0c40de5ee9a31bef0ff9e0b1fa0fd09b0372fd3 (diff)
Fix T62839 object scale changes normal map output in eevee
Was using the wrong vector length.
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c4
1 files changed, 2 insertions, 2 deletions
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);