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-04-21 18:32:32 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-04-21 18:42:47 +0300
commitaed9b6faee39f8049ca9a072f37d2c0c2ea3a760 (patch)
tree65a7dfa72350272a130c7c118947c157c48d1b62
parentb1fcc8e6ba25d5429cc868615c3b514e360ef912 (diff)
Fix some Cycles random walk SSS precision issues with small radius
-rw-r--r--intern/cycles/kernel/kernel_subsurface.h7
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;