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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-09-16 12:48:42 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-09-22 12:07:35 +0300
commitfc2b8c9793b55ca9674f46816028435ee50473c7 (patch)
treecb43a2797fbef577be7500b8fb54ede12769e431
parent8909ff0e6701ce31ed1431e96cf18f6966113241 (diff)
Fix T49372: Fresnel node: difference between 2.76 and 2.78 GLSL output
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_fresnel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_fresnel.c b/source/blender/nodes/shader/nodes/node_shader_fresnel.c
index b50f722c71b..ef2ce99c924 100644
--- a/source/blender/nodes/shader/nodes/node_shader_fresnel.c
+++ b/source/blender/nodes/shader/nodes/node_shader_fresnel.c
@@ -41,10 +41,12 @@ static bNodeSocketTemplate sh_node_fresnel_out[] = {
static int node_shader_gpu_fresnel(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
{
- if (!in[1].link)
+ if (!in[1].link) {
in[1].link = GPU_builtin(GPU_VIEW_NORMAL);
- else
+ }
+ else if (GPU_material_use_world_space_shading(mat)) {
GPU_link(mat, "direction_transform_m4v3", in[1].link, GPU_builtin(GPU_VIEW_MATRIX), &in[1].link);
+ }
return GPU_stack_link(mat, "node_fresnel", in, out, GPU_builtin(GPU_VIEW_POSITION));
}