From eaa4cdaa4230d69b470d229017bad27c03c9ef14 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 13 Jan 2022 00:09:22 +0100 Subject: Fix T94758: wrong denoising albedo with BSSRDF retro reflection --- intern/cycles/kernel/film/passes.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'intern') 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; -- cgit v1.2.3