diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-07-08 13:57:59 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-07-08 14:18:19 +0300 |
commit | 6435acd8f6f22a20a3eb62cc0b061f36def4bc5a (patch) | |
tree | 7e09f195ca1912629e168e7d46cf6a50c16d3d5c /intern/cycles/kernel/kernel_path.h | |
parent | 643196cc375cdaf31c3fa937ba50751376730f8b (diff) |
Cycles: support shader transparency for holdout objects
Now transparent areas of the object will render objects behind.
Fixes T78728.
Diffstat (limited to 'intern/cycles/kernel/kernel_path.h')
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index ba46d84d158..0e1c929696b 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -284,19 +284,11 @@ ccl_device_forceinline bool kernel_path_shader_apply(KernelGlobals *kg, #ifdef __HOLDOUT__ if (((sd->flag & SD_HOLDOUT) || (sd->object_flag & SD_OBJECT_HOLDOUT_MASK)) && (state->flag & PATH_RAY_TRANSPARENT_BACKGROUND)) { + const float3 holdout_weight = shader_holdout_apply(kg, sd); if (kernel_data.background.transparent) { - float3 holdout_weight; - if (sd->object_flag & SD_OBJECT_HOLDOUT_MASK) { - holdout_weight = make_float3(1.0f, 1.0f, 1.0f); - } - else { - holdout_weight = shader_holdout_eval(kg, sd); - } - /* any throughput is ok, should all be identical here */ L->transparent += average(holdout_weight * throughput); } - - if (sd->object_flag & SD_OBJECT_HOLDOUT_MASK) { + if (holdout_weight == make_float3(1.0f, 1.0f, 1.0f)) { return false; } } |