[Bf-blender-cvs] [fc2b8c9] blender-v2.78-release: Fix T49372: Fresnel node: difference between 2.76 and 2.78 GLSL output
Sergey Sharybin
noreply at git.blender.org
Thu Sep 22 11:15:20 CEST 2016
Commit: fc2b8c9793b55ca9674f46816028435ee50473c7
Author: Sergey Sharybin
Date: Fri Sep 16 11:48:42 2016 +0200
Branches: blender-v2.78-release
https://developer.blender.org/rBfc2b8c9793b55ca9674f46816028435ee50473c7
Fix T49372: Fresnel node: difference between 2.76 and 2.78 GLSL output
===================================================================
M source/blender/nodes/shader/nodes/node_shader_fresnel.c
===================================================================
diff --git a/source/blender/nodes/shader/nodes/node_shader_fresnel.c b/source/blender/nodes/shader/nodes/node_shader_fresnel.c
index b50f722..ef2ce99 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));
}
More information about the Bf-blender-cvs
mailing list