[Bf-blender-cvs] [eaa4cdaa423] master: Fix T94758: wrong denoising albedo with BSSRDF retro reflection

Brecht Van Lommel noreply at git.blender.org
Thu Jan 13 10:50:43 CET 2022


Commit: eaa4cdaa4230d69b470d229017bad27c03c9ef14
Author: Brecht Van Lommel
Date:   Thu Jan 13 00:09:22 2022 +0100
Branches: master
https://developer.blender.org/rBeaa4cdaa4230d69b470d229017bad27c03c9ef14

Fix T94758: wrong denoising albedo with BSSRDF retro reflection

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

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

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

diff --git a/intern/cycles/kernel/film/passes.h b/intern/cycles/kernel/film/passes.h
index 269e3620388..698eae29767 100644
--- a/intern/cycles/kernel/film/passes.h
+++ b/intern/cycles/kernel/film/passes.h
@@ -92,6 +92,14 @@ ccl_device_forceinline void kernel_write_denoising_features_surface(
     else if (sc->type == CLOSURE_BSDF_HAIR_PRINCIPLED_ID) {
       closure_albedo *= bsdf_principled_hair_albedo(sc);
     }
+    else if (sc->type == CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID) {
+      /* BSSRDF already accounts for weight, retro-reflection would double up. */
+      ccl_private const PrincipledDiffuseBsdf *bsdf = (ccl_private const PrincipledDiffuseBsdf *)
+          sc;
+      if (bsdf->components == PRINCIPLED_DIFFUSE_RETRO_REFLECTION) {
+        continue;
+      }
+    }
 
     if (bsdf_get_specular_roughness_squared(sc) > sqr(0.075f)) {
       diffuse_albedo += closure_albedo;



More information about the Bf-blender-cvs mailing list