diff options
author | Lukas Stockner <lukasstockner97> | 2019-11-27 23:22:55 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2019-11-27 23:26:47 +0300 |
commit | 4659fa547166b589cc8e3aef4b8dc699d95547df (patch) | |
tree | 908e87f5a75b6a6a4ad9783861cf2fadc14dc55c /intern/cycles/kernel/svm | |
parent | 7711231838e726055c6690757f3799dff90bfd96 (diff) |
Cycles: Scale denoising albedo contribution of Principled BSDFs according to average fresnel
The Principled BSDF uses Microfacet closures that include a fresnel term,
which are a special case since their weight tends to be near white even
if their average contribution is fairly low.
The sample weight is scaled by the average fresnel weight to account for
this, but the denoising albedo still used the unscaled weight.
This was fine for the original denoiser, but apparently OIDN can't handle
the resulting albedo pass well. Therefore, this commit adds the described
scaling to the albedo pass contribution as well.
This problem was described in T69770.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6289
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r-- | intern/cycles/kernel/svm/svm_types.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h index 01710f713ac..aa4dfdca2d1 100644 --- a/intern/cycles/kernel/svm/svm_types.h +++ b/intern/cycles/kernel/svm/svm_types.h @@ -552,6 +552,12 @@ typedef enum ClosureType { (type >= CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID && \ type <= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) || \ (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID)) +#define CLOSURE_IS_BSDF_MICROFACET_FRESNEL(type) \ + (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID || \ + type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID || \ + type == CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID || \ + type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID || \ + type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID) #define CLOSURE_IS_BSDF_OR_BSSRDF(type) (type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID) #define CLOSURE_IS_BSSRDF(type) \ (type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID) |