Fix T94758: wrong denoising albedo with BSSRDF retro reflection

This commit is contained in:
Brecht Van Lommel 2022-01-13 00:09:22 +01:00
parent 29450a2af3
commit eaa4cdaa42
Notes: blender-bot 2023-02-14 05:52:32 +01:00
Referenced by issue #97792, Regression: Optix denoiser produces significant artifacts on materials with subsurface scattering
Referenced by issue #94758, Harsh lines in `Denoising Albedo` with subsurface scattering materials
1 changed files with 8 additions and 0 deletions

View File

@ -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;