[Bf-blender-cvs] [e596936336d] cycles-x: Cycles X: Support shadow catcher behind transparent object

Sergey Sharybin noreply at git.blender.org
Fri Jul 16 14:42:20 CEST 2021


Commit: e596936336d9a8ac4854a415e00353213f1e0253
Author: Sergey Sharybin
Date:   Fri Jul 16 12:44:08 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBe596936336d9a8ac4854a415e00353213f1e0253

Cycles X: Support shadow catcher behind transparent object

Seems to be rather straightforward.
Think initially it was less obvious to do, until we've started to count
number of samples for the shadow catcher pass.

Note that this is only about support of Transparent BSDF. Glass BSDF
can not be supported as it refracts light, which is not possible to
store as a shadow catcher pass.

Differential Revision: https://developer.blender.org/D11946

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

M	intern/cycles/kernel/kernel_passes.h

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

diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h
index 3ac76774add..568886a2104 100644
--- a/intern/cycles/kernel/kernel_passes.h
+++ b/intern/cycles/kernel/kernel_passes.h
@@ -148,9 +148,9 @@ ccl_device_forceinline void kernel_write_shadow_catcher_bounce_data(
 
   /* Since the split is done, the sample does not contribute to the matte, so accumulate it as
    * transparency to the matte. */
-  /* TODO(sergey): Use contribution and transparency based on the throughput, allowing to have
-   * transparent object between camera and shadow catcher. */
-  kernel_write_pass_float(buffer + kernel_data.film.pass_shadow_catcher_matte + 3, 1.0f);
+  const float3 throughput = INTEGRATOR_STATE(path, throughput);
+  kernel_write_pass_float(buffer + kernel_data.film.pass_shadow_catcher_matte + 3,
+                          average(throughput));
 }
 
 #endif /* __SHADOW_CATCHER__ */



More information about the Bf-blender-cvs mailing list