[Bf-blender-cvs] [15ad75ffefc] blender2.8: Eevee: Correctly handle Sharp glossy/refraction BSDF nodes

Clément Foucault noreply at git.blender.org
Tue Nov 6 12:05:29 CET 2018


Commit: 15ad75ffefca8d0fa800fddd8c57e9d578dfa0f4
Author: Clément Foucault
Date:   Mon Nov 5 20:07:47 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB15ad75ffefca8d0fa800fddd8c57e9d578dfa0f4

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.

===================================================================

M	source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c
M	source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c

===================================================================

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



More information about the Bf-blender-cvs mailing list