diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2020-01-21 00:54:58 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2020-01-21 01:06:08 +0300 |
commit | 902209eda52756f510c7ac21c9075e5ea465ad9e (patch) | |
tree | c0e13b94a852beafb58ad67930f509788adef0ed /intern/cycles/kernel/kernel_passes.h | |
parent | aee2b754dc8f5c4ddaf840cd83f979dd22fe4dc3 (diff) |
Partial Fix T73043: Denoising Albedo not working well for Sheen
Similar to the Microfacet Closures, the Principled BSDF Sheen closure is
added at a high weight but typically results in fairly low values.
Therefore, the default weight is a bad indicator of importance.
The fix here is the same as it was back then for Microfacets:
Compute an average weight using the normal as the half-vector
and use it to scale down the sample weight and the albedo channel.
In addition to drastically improving denoising of materials with
sheen when using the new Denoising node, this also can reduce noise
on such materials considerably.
Diffstat (limited to 'intern/cycles/kernel/kernel_passes.h')
-rw-r--r-- | intern/cycles/kernel/kernel_passes.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h index d372a4f3e61..7345e9ee5bb 100644 --- a/intern/cycles/kernel/kernel_passes.h +++ b/intern/cycles/kernel/kernel_passes.h @@ -80,6 +80,10 @@ ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg, MicrofacetBsdf *bsdf = (MicrofacetBsdf *)sc; closure_albedo *= bsdf->extra->fresnel_color; } + else if (sc->type == CLOSURE_BSDF_PRINCIPLED_SHEEN_ID) { + PrincipledSheenBsdf *bsdf = (PrincipledSheenBsdf *)sc; + closure_albedo *= bsdf->avg_value; + } albedo += closure_albedo; sum_nonspecular_weight += sc->sample_weight; |