Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-10-08 20:44:56 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-10-11 19:22:54 +0300
commita94343a8afcac5d6db09c8461e67ad1ba5a85d35 (patch)
treef56b8e6a956ca87f25b01f94b6f6421636448402 /intern/cycles/kernel/kernel_types.h
parent73a05ff9e83a31be34d32a92cd5fb4d17994e342 (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/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index eb681683d6a..00457695e53 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -263,32 +263,34 @@ enum PathRayFlag {
/* Perform subsurface scattering. */
PATH_RAY_SUBSURFACE_RANDOM_WALK = (1 << 20),
PATH_RAY_SUBSURFACE_DISK = (1 << 21),
- PATH_RAY_SUBSURFACE = (PATH_RAY_SUBSURFACE_RANDOM_WALK | PATH_RAY_SUBSURFACE_DISK),
+ PATH_RAY_SUBSURFACE_USE_FRESNEL = (1 << 22),
+ PATH_RAY_SUBSURFACE = (PATH_RAY_SUBSURFACE_RANDOM_WALK | PATH_RAY_SUBSURFACE_DISK |
+ PATH_RAY_SUBSURFACE_USE_FRESNEL),
/* Contribute to denoising features. */
- PATH_RAY_DENOISING_FEATURES = (1 << 22),
+ PATH_RAY_DENOISING_FEATURES = (1 << 23),
/* Render pass categories. */
- PATH_RAY_REFLECT_PASS = (1 << 23),
- PATH_RAY_TRANSMISSION_PASS = (1 << 24),
- PATH_RAY_VOLUME_PASS = (1 << 25),
+ PATH_RAY_REFLECT_PASS = (1 << 24),
+ PATH_RAY_TRANSMISSION_PASS = (1 << 25),
+ PATH_RAY_VOLUME_PASS = (1 << 26),
PATH_RAY_ANY_PASS = (PATH_RAY_REFLECT_PASS | PATH_RAY_TRANSMISSION_PASS | PATH_RAY_VOLUME_PASS),
/* Shadow ray is for a light or surface. */
- PATH_RAY_SHADOW_FOR_LIGHT = (1 << 26),
+ PATH_RAY_SHADOW_FOR_LIGHT = (1 << 27),
/* A shadow catcher object was hit and the path was split into two. */
- PATH_RAY_SHADOW_CATCHER_HIT = (1 << 27),
+ PATH_RAY_SHADOW_CATCHER_HIT = (1 << 28),
/* A shadow catcher object was hit and this path traces only shadow catchers, writing them into
* their dedicated pass for later division.
*
* NOTE: Is not covered with `PATH_RAY_ANY_PASS` because shadow catcher does special handling
* which is separate from the light passes. */
- PATH_RAY_SHADOW_CATCHER_PASS = (1 << 28),
+ PATH_RAY_SHADOW_CATCHER_PASS = (1 << 29),
/* Path is evaluating background for an approximate shadow catcher with non-transparent film. */
- PATH_RAY_SHADOW_CATCHER_BACKGROUND = (1 << 29),
+ PATH_RAY_SHADOW_CATCHER_BACKGROUND = (1 << 30),
};
/* Configure ray visibility bits for rays and objects respectively,