[Bf-blender-cvs] [668ffcd] master: Fix for wrong flip of Normal node Dot output for new shading system

Sergey Sharybin noreply at git.blender.org
Wed Dec 10 14:51:12 CET 2014


Commit: 668ffcd6e94cb843bf7d00a7bc5a5f454dd5e49a
Author: Sergey Sharybin
Date:   Wed Dec 10 18:50:30 2014 +0500
Branches: master
https://developer.blender.org/rB668ffcd6e94cb843bf7d00a7bc5a5f454dd5e49a

Fix for wrong flip of Normal node Dot output for new shading system

It was wrong to use invert(), we need to multiply by -1 instead.

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

M	source/blender/nodes/shader/nodes/node_shader_normal.c

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

diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c
index fcd738f..847d2e6 100644
--- a/source/blender/nodes/shader/nodes/node_shader_normal.c
+++ b/source/blender/nodes/shader/nodes/node_shader_normal.c
@@ -63,8 +63,8 @@ static int gpu_shader_normal(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecDat
 	GPUNodeLink *vec = GPU_uniform(out[0].vec);
 	int ret = GPU_stack_link(mat, "normal", in, out, vec);
 	if (ret && GPU_material_use_new_shading_nodes(mat)) {
-		float fac[3] = {1.0f, 0.0f, 0.0f};
-		GPU_link(mat, "invert", GPU_uniform(fac), out[1].link, &out[1].link);
+		float fac[3] = {-1.0f, -1.0f, -1.0f};
+		GPU_link(mat, "math_multiply", GPU_uniform(fac), out[1].link, &out[1].link);
 	}
 	return ret;
 }




More information about the Bf-blender-cvs mailing list