diff options
Diffstat (limited to 'intern/cycles/kernel/bvh/qbvh_shadow_all.h')
-rw-r--r-- | intern/cycles/kernel/bvh/qbvh_shadow_all.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/intern/cycles/kernel/bvh/qbvh_shadow_all.h b/intern/cycles/kernel/bvh/qbvh_shadow_all.h index 3a728b388eb..34753ff067d 100644 --- a/intern/cycles/kernel/bvh/qbvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/qbvh_shadow_all.h @@ -337,6 +337,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, /* Shadow ray early termination. */ if(hit) { + /* Update number of hits now, so we do proper check on max bounces. */ + (*num_hits)++; + /* detect if this surface has a shader with transparent shadows */ /* todo: optimize so primitive visibility flag indicates if @@ -367,13 +370,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, return true; } - /* move on to next entry in intersections array */ - isect_array++; - (*num_hits)++; #if BVH_FEATURE(BVH_INSTANCING) num_hits_in_instance++; #endif - + /* Move on to next entry in intersections array */ + isect_array++; isect_array->t = isect_t; } |