diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-08 20:44:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-11 19:22:54 +0300 |
commit | a94343a8afcac5d6db09c8461e67ad1ba5a85d35 (patch) | |
tree | f56b8e6a956ca87f25b01f94b6f6421636448402 /intern/cycles/kernel/svm | |
parent | 73a05ff9e83a31be34d32a92cd5fb4d17994e342 (diff) |
Cycles: improve SSS Fresnel and retro-reflection in Principled BSDF
For details see the "Extending the Disney BRDF to a BSDF with Integrated
Subsurface Scattering" paper.
We split the diffuse BSDF into a lambertian and retro-reflection component.
The retro-reflection component is always handled as a BSDF, while the
lambertian component can be replaced by a BSSRDF.
For the BSSRDF case, we compute Fresnel separately at the entry and exit
points, which may have different normals. As the scattering radius decreases
this converges to the BSDF case.
A downside is that this increases noise for subsurface scattering in the
Principled BSDF, due to some samples going to the retro-reflection component.
However the previous logic (also in 2.93) was simple wrong, using a
non-sensical view direction vector at the exit point. We use an importance
sampling weight estimate for the retro-reflection to try to better balance
samples between the BSDF and BSSRDF.
Differential Revision: https://developer.blender.org/D12801
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r-- | intern/cycles/kernel/svm/svm_closure.h | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_types.h | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/intern/cycles/kernel/svm/svm_closure.h b/intern/cycles/kernel/svm/svm_closure.h index b3f7fee8a63..e55f76a4400 100644 --- a/intern/cycles/kernel/svm/svm_closure.h +++ b/intern/cycles/kernel/svm/svm_closure.h @@ -221,7 +221,7 @@ ccl_device_noinline int svm_node_closure_bsdf( bsdf->roughness = roughness; /* setup bsdf */ - sd->flag |= bsdf_principled_diffuse_setup(bsdf); + sd->flag |= bsdf_principled_diffuse_setup(bsdf, PRINCIPLED_DIFFUSE_FULL); } } else if (subsurface > CLOSURE_WEIGHT_CUTOFF) { @@ -255,7 +255,7 @@ ccl_device_noinline int svm_node_closure_bsdf( bsdf->roughness = roughness; /* setup bsdf */ - sd->flag |= bsdf_principled_diffuse_setup(bsdf); + sd->flag |= bsdf_principled_diffuse_setup(bsdf, PRINCIPLED_DIFFUSE_FULL); } } # endif diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h index e846e4af259..6f6c101fb69 100644 --- a/intern/cycles/kernel/svm/svm_types.h +++ b/intern/cycles/kernel/svm/svm_types.h @@ -538,8 +538,6 @@ typedef enum ClosureType { CLOSURE_BSDF_HAIR_TRANSMISSION_ID, /* Special cases */ - CLOSURE_BSDF_BSSRDF_ID, - CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID, CLOSURE_BSDF_TRANSPARENT_ID, /* BSSRDF */ @@ -569,8 +567,6 @@ typedef enum ClosureType { (type == CLOSURE_BSDF_HAIR_PRINCIPLED_ID)) #define CLOSURE_IS_BSDF_TRANSMISSION(type) \ (type >= CLOSURE_BSDF_REFRACTION_ID && type <= CLOSURE_BSDF_HAIR_TRANSMISSION_ID) -#define CLOSURE_IS_BSDF_BSSRDF(type) \ - (type == CLOSURE_BSDF_BSSRDF_ID || type == CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID) #define CLOSURE_IS_BSDF_SINGULAR(type) \ (type == CLOSURE_BSDF_REFLECTION_ID || type == CLOSURE_BSDF_REFRACTION_ID || \ type == CLOSURE_BSDF_TRANSPARENT_ID) |