diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-03-24 20:30:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-03-24 21:42:59 +0300 |
commit | 9ef400ddf74731057b7259b1ed449ad9f3ebd772 (patch) | |
tree | 2081bacae08e9c1c6de645046beeecb46ec4003c | |
parent | 4a1b0ea90231e2bc45d174724839e52eec52e079 (diff) |
Cycles: don't write light passes for shadow catcher objects
Makes it easier to composite the Combined image from these passes.
Fixes T96758
-rw-r--r-- | intern/cycles/kernel/film/accumulate.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/kernel/film/accumulate.h b/intern/cycles/kernel/film/accumulate.h index 6345430e4f4..d6a385a4bff 100644 --- a/intern/cycles/kernel/film/accumulate.h +++ b/intern/cycles/kernel/film/accumulate.h @@ -352,6 +352,12 @@ ccl_device_inline void kernel_accum_emission_or_background_pass(KernelGlobals kg pass_offset = pass; } else if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) { + /* Don't write any light passes for shadow catcher, for easier + * compositing back together of the combined pass. */ + if (path_flag & PATH_RAY_SHADOW_CATCHER_HIT) { + return; + } + if (path_flag & PATH_RAY_SURFACE_PASS) { /* Indirectly visible through reflection. */ const float3 diffuse_weight = INTEGRATOR_STATE(state, path, pass_diffuse_weight); @@ -437,6 +443,12 @@ ccl_device_inline void kernel_accum_light(KernelGlobals kg, if (kernel_data.film.light_pass_flag & PASS_ANY) { const uint32_t path_flag = INTEGRATOR_STATE(state, shadow_path, flag); + /* Don't write any light passes for shadow catcher, for easier + * compositing back together of the combined pass. */ + if (path_flag & PATH_RAY_SHADOW_CATCHER_HIT) { + return; + } + if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) { int pass_offset = PASS_UNUSED; |