From dc1db0791ec3b2d52e6734054a001814cd6998ee Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Tue, 21 Jan 2020 04:45:51 +0100 Subject: Cycles: Track specular throughput to account for reflection color in denoising albedo pass To determine the albedo pass, Cycles currently follows the path until a predominantly diffuse-ish material is hit and then takes the albedo there. This works fine for normal mirrors, but as it completely ignores the color of the bounces before that diffuse-ish material, it also means that any textures that are applied to the specular-ish BSDFs won't affect the albedo pass at all. Therefore, this patch changes that behaviour so that Cycles also keeps track of the throughput of all specular-ish closures along the path so far and includes that in the albedo pass. This fixes part of the issue described in T73043. However, since it has an effect on the albedo pass in most scenes, it could cause cause regressions, which is why I'm uploading it as a patch instead of just committing as a fix. Differential Revision: https://developer.blender.org/D6640 --- intern/cycles/kernel/kernel_accumulate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'intern/cycles/kernel/kernel_accumulate.h') diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h index 606c288649a..9ea75d54c5d 100644 --- a/intern/cycles/kernel/kernel_accumulate.h +++ b/intern/cycles/kernel/kernel_accumulate.h @@ -528,7 +528,8 @@ ccl_device_inline void path_radiance_accum_background(KernelGlobals *kg, } #ifdef __DENOISING_FEATURES__ - L->denoising_albedo += state->denoising_feature_weight * value; + L->denoising_albedo += state->denoising_feature_weight * state->denoising_feature_throughput * + value; #endif /* __DENOISING_FEATURES__ */ } -- cgit v1.2.3