diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-11-04 20:13:57 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-11-04 20:13:57 +0300 |
commit | 7a8c8ec5e990765bab2e8db6b54ed4f0e80c2a2b (patch) | |
tree | 78274c9fb9f62f8fc64145ca4c4ad64daa1362b6 /source/blender/nodes | |
parent | c937f9c4e76c04cc245775d39cd2684e65515863 (diff) | |
parent | fd110291a5f133042511dee3648c354fca141a43 (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_output_material.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_output_material.c b/source/blender/nodes/shader/nodes/node_shader_output_material.c index 578262e9f17..fb0b6e7b263 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_material.c @@ -45,18 +45,29 @@ static int node_shader_gpu_output_material(GPUMaterial *mat, GPUNodeStack *in, GPUNodeStack *out) { - GPUNodeLink *outlink, *alpha_threshold_link; - + GPUNodeLink *outlink, *alpha_threshold_link, *shadow_threshold_link; Material *ma = GPU_material_get_material(mat); - if (ma && ma->blend_method == MA_BM_CLIP) { - alpha_threshold_link = GPU_uniform(&ma->alpha_threshold); + + static float no_alpha_threshold = -1.0f; + if (ma) { + alpha_threshold_link = GPU_uniform((ma->blend_method == MA_BM_CLIP) ? &ma->alpha_threshold : + &no_alpha_threshold); + shadow_threshold_link = GPU_uniform((ma->blend_shadow == MA_BS_CLIP) ? &ma->alpha_threshold : + &no_alpha_threshold); } else { - static float no_alpha_threshold = -1.0f; alpha_threshold_link = GPU_uniform(&no_alpha_threshold); + shadow_threshold_link = GPU_uniform(&no_alpha_threshold); } - GPU_stack_link(mat, node, "node_output_material", in, out, alpha_threshold_link, &outlink); + GPU_stack_link(mat, + node, + "node_output_material", + in, + out, + alpha_threshold_link, + shadow_threshold_link, + &outlink); GPU_material_output_link(mat, outlink); return true; |