[Bf-blender-cvs] [9ef400ddf74] master: Cycles: don't write light passes for shadow catcher objects

Brecht Van Lommel noreply at git.blender.org
Thu Mar 24 19:43:41 CET 2022


Commit: 9ef400ddf74731057b7259b1ed449ad9f3ebd772
Author: Brecht Van Lommel
Date:   Thu Mar 24 18:30:27 2022 +0100
Branches: master
https://developer.blender.org/rB9ef400ddf74731057b7259b1ed449ad9f3ebd772

Cycles: don't write light passes for shadow catcher objects

Makes it easier to composite the Combined image from these passes.

Fixes T96758

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

M	intern/cycles/kernel/film/accumulate.h

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

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;



More information about the Bf-blender-cvs mailing list