diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-09-24 17:11:43 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-09-24 17:11:53 +0300 |
commit | a2cc855dbac955e8ec111a434c2d215eb161c064 (patch) | |
tree | 6fd9d684cc5f594d8a11bb21adfd93d670649bdb /source | |
parent | f94f4e1d79f73e55ac215dd4cccc287c3611f68d (diff) |
Fix T68736 EEVEE: Loose subsurface node breaks shader
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c index 9a0a132b311..9f93dfd837b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c +++ b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c @@ -61,8 +61,6 @@ static int node_shader_gpu_subsurface_scattering(GPUMaterial *mat, GPU_link(mat, "world_normals_get", &in[5].link); } - GPU_material_flag_set(mat, GPU_MATFLAG_DIFFUSE | GPU_MATFLAG_SSS); - if (node->sss_id > 0) { bNodeSocket *socket = BLI_findlink(&node->original->inputs, 2); bNodeSocketValueRGBA *socket_data = socket->default_value; @@ -71,6 +69,10 @@ static int node_shader_gpu_subsurface_scattering(GPUMaterial *mat, /* For some reason it seems that the socket value is in ARGB format. */ GPU_material_sss_profile_create( mat, &socket_data->value[1], &node->original->custom1, &socket_data_sharp->value); + + /* sss_id is 0 only the node is not connected to any output. + * In this case flagging the material would trigger a bug (see T68736). */ + GPU_material_flag_set(mat, GPU_MATFLAG_DIFFUSE | GPU_MATFLAG_SSS); } return GPU_stack_link( |