Cycles: Fix wrong termination criteria in SSS volume stack update
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Apr 2015 20:20:17 +0000 (01:20 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Apr 2015 20:20:17 +0000 (01:20 +0500)
Another issue spotted with Thomas.

intern/cycles/kernel/kernel_volume.h

index 3d3d871a702fc449c5ded8cc762eb0586f703d08..32c7e4eef0921a943594d35cff433fbd43e5fd3d 100644 (file)
@@ -1107,8 +1107,8 @@ ccl_device void kernel_volume_stack_update_for_subsurface(KernelGlobals *kg,
        Ray volume_ray = *ray;
        Intersection isect;
        int step = 0;
-       while(step < VOLUME_STACK_SIZE &&
-                 scene_intersect_volume(kg, &volume_ray, &isect))
+       while(step < 2 * VOLUME_STACK_SIZE &&
+             scene_intersect_volume(kg, &volume_ray, &isect))
        {
                ShaderData sd;
                shader_setup_from_ray(kg, &sd, &isect, &volume_ray, 0, 0);