Commit: 347c82be6dba0e35aca1e9fe2e417b256998786f
Author: Lukas Stockner
Date:   Sun Nov 27 02:40:11 2022 +0100
Branches: master
https://developer.blender.org/rB347c82be6dba0e35aca1e9fe2e417b256998786f

Fix T98951: Shadow catcher objects are double-counting data passes

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

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

M       intern/cycles/kernel/film/data_passes.h
M       intern/cycles/kernel/film/denoising_passes.h

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

diff --git a/intern/cycles/kernel/film/data_passes.h 
b/intern/cycles/kernel/film/data_passes.h
index 3c538a74978..0ed5828ff30 100644
--- a/intern/cycles/kernel/film/data_passes.h
+++ b/intern/cycles/kernel/film/data_passes.h
@@ -33,6 +33,12 @@ ccl_device_inline void film_write_data_passes(KernelGlobals 
kg,
     return;
   }
 
+  /* Don't write data passes for paths that were split off for shadow catchers
+   * to avoid double-counting. */
+  if (path_flag & PATH_RAY_SHADOW_CATCHER_PASS) {
+    return;
+  }
+
   const int flag = kernel_data.film.pass_flag;
 
   if (!(flag & PASS_ANY)) {
diff --git a/intern/cycles/kernel/film/denoising_passes.h 
b/intern/cycles/kernel/film/denoising_passes.h
index dfc21d787f2..0a32df19a3e 100644
--- a/intern/cycles/kernel/film/denoising_passes.h
+++ b/intern/cycles/kernel/film/denoising_passes.h
@@ -16,7 +16,8 @@ ccl_device_forceinline void 
film_write_denoising_features_surface(KernelGlobals
                                                                   ccl_global 
float *ccl_restrict
                                                                       
render_buffer)
 {
-  if (!(INTEGRATOR_STATE(state, path, flag) & PATH_RAY_DENOISING_FEATURES)) {
+  const uint32_t path_flag = INTEGRATOR_STATE(state, path, flag);
+  if (!(path_flag & PATH_RAY_DENOISING_FEATURES)) {
     return;
   }
 
@@ -25,6 +26,12 @@ ccl_device_forceinline void 
film_write_denoising_features_surface(KernelGlobals
     return;
   }
 
+  /* Don't write denoising passes for paths that were split off for shadow 
catchers
+   * to avoid double-counting. */
+  if (path_flag & PATH_RAY_SHADOW_CATCHER_PASS) {
+    return;
+  }
+
   ccl_global float *buffer = film_pass_pixel_render_buffer(kg, state, 
render_buffer);
 
   if (kernel_data.film.pass_denoising_depth != PASS_UNUSED) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to