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>2017-08-15 10:36:23 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-08-18 16:07:17 +0300
commit95b1b7756d6e09b0bcf98c120de2b6552c1848be (patch)
treefa13963580f26979825ed7b39352ab02e4b10bf2 /source/blender/nodes
parentf4bd416b342ba840b5c3660526e0a938b7730cce (diff)
Eevee: Fix some problem with Glass & Diffuse BSDF with SSR
Diffuse was not outputing the right normal. (this is not a problem with SSR actually) Glass did not have proper ssr_id and was receiving environment lighting twice. Also it did not have proper fresnel on lamps.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c1
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index 29cfc6b0f17..b90297cc631 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -486,6 +486,7 @@ static bool ntree_tag_ssr_bsdf_cb(bNode *fromnode, bNode *UNUSED(tonode), void *
case SH_NODE_EEVEE_SPECULAR:
case SH_NODE_BSDF_PRINCIPLED:
case SH_NODE_BSDF_GLOSSY:
+ case SH_NODE_BSDF_GLASS:
fromnode->ssr_id = (*(float *)userdata);
(*(float *)userdata) += 1;
break;
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
index 25f76ba9ecb..1537e07ca16 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
@@ -52,7 +52,7 @@ static int node_shader_gpu_bsdf_glass(GPUMaterial *mat, bNode *node, bNodeExecDa
if (!in[3].link)
GPU_link(mat, "world_normals_get", &in[3].link);
- return GPU_stack_link(mat, node, "node_bsdf_glass", in, out);
+ return GPU_stack_link(mat, node, "node_bsdf_glass", in, out, GPU_uniform(&node->ssr_id));
}
/* node type definition */