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.
This commit is contained in:
Clément Foucault 2018-11-05 20:07:47 +01:00
parent 5ccd60e0e7
commit 15ad75ffef
2 changed files with 6 additions and 0 deletions

View File

@ -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));

View File

@ -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);