diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-02-05 14:06:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-02-05 14:10:50 +0300 |
commit | 25f33e058a7b57d4f5964609b29b3f0834b3e6b6 (patch) | |
tree | c27cf5f17ee6baad816a6f9df94ceb5aa948b488 /intern/cycles/kernel/kernel_path.h | |
parent | 0527fc5fb8eb370eb4cc9cca9d3031992775d8cf (diff) |
Fix T43562: Cycles gets stuck with camera in volume in certain setup
The issue was caused by the way how we shoot the ray to see which rays we're
inside which might start bouncing back-n-forth between two close to parallel
intersecting faces.
Real solution would be to record all the intersections when shooting the ray,
but it's kinda tricky on GPU because of needed sorting and uncertainty of
how huge intersection array should be.
For now we'll just limit number of steps in the check so in worst case we'll
have some samples not being correct which will be compensated with further
sampling. Shouldn't be an issue since probability of such a lock is quite
small actually.
Diffstat (limited to 'intern/cycles/kernel/kernel_path.h')
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 8eb6866068e..a1012cf2b72 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -373,8 +373,9 @@ ccl_device void kernel_path_subsurface_update_volume_stack(KernelGlobals *kg, Ray volume_ray = *ray; Intersection isect; - - while(scene_intersect_volume(kg, &volume_ray, &isect)) + int step = 0; + while(step < VOLUME_STACK_SIZE && + scene_intersect_volume(kg, &volume_ray, &isect)) { ShaderData sd; shader_setup_from_ray(kg, &sd, &isect, &volume_ray, 0, 0); @@ -383,6 +384,7 @@ ccl_device void kernel_path_subsurface_update_volume_stack(KernelGlobals *kg, /* Move ray forward. */ volume_ray.P = ray_offset(sd.P, -sd.Ng); volume_ray.t -= sd.ray_length; + ++step; } } #endif |