diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-30 14:24:03 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-30 14:24:43 +0400 |
commit | 7dbedf6d4ac719d5e452091d82d902cf99c47471 (patch) | |
tree | ebd77c92041f1af04bb20bc04e16916388b263bf /source/blender/nodes | |
parent | cb95544e41864280cbf7df315ede5447f3a2a867 (diff) |
Fix T40795: Dot output is inverted in viewport with Cycles
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_normal.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c index 22b27ce4b71..fcd738f0b15 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal.c @@ -61,7 +61,12 @@ static void node_shader_exec_normal(void *UNUSED(data), int UNUSED(thread), bNod static int gpu_shader_normal(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { GPUNodeLink *vec = GPU_uniform(out[0].vec); - return GPU_stack_link(mat, "normal", in, out, 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); + } + return ret; } void register_node_type_sh_normal(void) |