diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-04-21 19:00:26 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-04-21 19:00:26 +0300 |
commit | ef9551afd158c04437ec35a10b0aee107ae342aa (patch) | |
tree | d0797eb845e91b6e47406a45fe1607d72c30f32a /intern/cycles/kernel | |
parent | 3da74c1c18dca19af9e2745ff9ea5ad587f3b47e (diff) | |
parent | aed9b6faee39f8049ca9a072f37d2c0c2ea3a760 (diff) |
Merge branch 'blender-v2.93-release'
Diffstat (limited to 'intern/cycles/kernel')
-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; |