[Bf-blender-cvs] [18920a7c566] cycles-x: Fix Denoising Albedo pass behind glass in Cycles X

Sergey Sharybin noreply at git.blender.org
Mon Jul 5 14:20:19 CEST 2021


Commit: 18920a7c5660535c18bbcc207a14db04331fae89
Author: Sergey Sharybin
Date:   Mon Jul 5 12:27:51 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB18920a7c5660535c18bbcc207a14db04331fae89

Fix Denoising Albedo pass behind glass in Cycles X

Makes the albedo pass match to what it used to be before the split
kernel redesign.

The normal is all zeroes, which is a bit counter-intuitive, but is
how it used to be as well.

Test file: {F10211946}

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

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

M	intern/cycles/kernel/kernel_accumulate.h

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

diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h
index 54b8ff79df5..2940b162eb0 100644
--- a/intern/cycles/kernel/kernel_accumulate.h
+++ b/intern/cycles/kernel/kernel_accumulate.h
@@ -491,22 +491,22 @@ ccl_device_inline void kernel_accum_emission_or_background_pass(INTEGRATOR_STATE
   const int path_flag = INTEGRATOR_STATE(path, flag);
   int pass_offset = PASS_UNUSED;
 
-  if (!(path_flag & PATH_RAY_ANY_PASS)) {
-    /* Directly visible, write to emission or background pass. */
-    pass_offset = pass;
-
-    /* Denoising albedo. */
+  /* Denoising albedo. */
 #  ifdef __DENOISING_FEATURES__
-    if (path_flag & PATH_RAY_DENOISING_FEATURES) {
-      if (kernel_data.film.pass_denoising_albedo != PASS_UNUSED) {
-        const float3 denoising_feature_throughput = INTEGRATOR_STATE(path,
-                                                                     denoising_feature_throughput);
-        const float3 denoising_albedo = denoising_feature_throughput * contribution;
-        kernel_write_pass_float3_unaligned(buffer + kernel_data.film.pass_denoising_albedo,
-                                           denoising_albedo);
-      }
+  if (path_flag & PATH_RAY_DENOISING_FEATURES) {
+    if (kernel_data.film.pass_denoising_albedo != PASS_UNUSED) {
+      const float3 denoising_feature_throughput = INTEGRATOR_STATE(path,
+                                                                   denoising_feature_throughput);
+      const float3 denoising_albedo = denoising_feature_throughput * contribution;
+      kernel_write_pass_float3_unaligned(buffer + kernel_data.film.pass_denoising_albedo,
+                                         denoising_albedo);
     }
+  }
 #  endif /* __DENOISING_FEATURES__ */
+
+  if (!(path_flag & PATH_RAY_ANY_PASS)) {
+    /* Directly visible, write to emission or background pass. */
+    pass_offset = pass;
   }
   else if (path_flag & PATH_RAY_REFLECT_PASS) {
     /* Indirectly visible through reflection. */



More information about the Bf-blender-cvs mailing list