diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-04-21 18:32:32 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-04-21 18:42:47 +0300 |
commit | aed9b6faee39f8049ca9a072f37d2c0c2ea3a760 (patch) | |
tree | 65a7dfa72350272a130c7c118947c157c48d1b62 /intern | |
parent | b1fcc8e6ba25d5429cc868615c3b514e360ef912 (diff) |
Fix some Cycles random walk SSS precision issues with small radius
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/kernel_subsurface.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h index c75958e79c5..0a56f867158 100644 --- a/intern/cycles/kernel/kernel_subsurface.h +++ b/intern/cycles/kernel/kernel_subsurface.h @@ -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; |