Fix some Cycles random walk SSS precision issues with small radius

This commit is contained in:
Brecht Van Lommel 2021-04-21 17:32:32 +02:00
parent b1fcc8e6ba
commit aed9b6faee
Notes: blender-bot 2023-02-14 02:38:46 +01:00
Referenced by issue #64620, Random Walk SSS in Principled BSDF gives very dark result for small subsurface inputs
1 changed files with 7 additions and 0 deletions

View File

@ -605,6 +605,13 @@ ccl_device_noinline
if (hit) {
t = ray->t;
}
else if (bounce == 0) {
/* Restore original position if nothing was hit after the first bounce.
* Otherwise if the ray_offset() to avoid self-intersection is relatively
* large compared to the scattering radius, we go never backup high enough
* to exit the surface. */
ray->P = sd->P;
}
/* Advance to new scatter location. */
ray->P += t * ray->D;