diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-05 22:07:47 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-06 14:05:21 +0300 |
commit | 15ad75ffefca8d0fa800fddd8c57e9d578dfa0f4 (patch) | |
tree | b5e30b9962e94cd703a02b1ed2626c7c82a4f827 /source/blender/nodes | |
parent | 5ccd60e0e7ceb2e4c8028de54400c3c5b3692f87 (diff) |
Eevee: Correctly handle Sharp glossy/refraction BSDF nodes
This is a quick workaround, but I don't see the point of making the
lighting functions more complex than it is now in order to optimize this
rather not so common case.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c | 3 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c index 342b3a67ffb..bd1c5e8f348 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c @@ -51,6 +51,9 @@ static int node_shader_gpu_bsdf_glossy(GPUMaterial *mat, bNode *node, bNodeExecD if (!in[2].link) GPU_link(mat, "world_normals_get", &in[2].link); + if (node->custom1 == SHD_GLOSSY_SHARP) + GPU_link(mat, "set_value_zero", &in[1].link); + GPU_material_flag_set(mat, GPU_MATFLAG_GLOSSY); return GPU_stack_link(mat, node, "node_bsdf_glossy", in, out, GPU_constant(&node->ssr_id)); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c index b59f1c80342..0b7b50d0b0a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c @@ -52,6 +52,9 @@ static int node_shader_gpu_bsdf_refraction(GPUMaterial *mat, bNode *node, bNodeE if (!in[3].link) GPU_link(mat, "world_normals_get", &in[3].link); + if (node->custom1 == SHD_GLOSSY_SHARP) + GPU_link(mat, "set_value_zero", &in[1].link); + GPU_material_flag_set(mat, GPU_MATFLAG_REFRACT); return GPU_stack_link(mat, node, "node_bsdf_refraction", in, out); |