diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-26 17:30:13 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-26 18:16:23 +0300 |
commit | 70307941715f1274b9ca7f859fcc93ab5f5c5c66 (patch) | |
tree | 28a3019e739e2a71b0b66e608ab339f9d8611a58 /intern/cycles/kernel/bvh/bvh_shadow_all.h | |
parent | b91aea60964e8f01b2ed269734bc2700659fcbb1 (diff) |
Cycles: Revert previous fixes to intersect_all functions
While they prevent legit write past the array boundary error
those fixes introduced regression in behavior when having exact
max_hits transparent intersections and nothing else.
Previous code would have considered such case a totally opaque,
but it's not correct.
Fixes T48941: Some materials don't get transparent shadows anymore
Diffstat (limited to 'intern/cycles/kernel/bvh/bvh_shadow_all.h')
-rw-r--r-- | intern/cycles/kernel/bvh/bvh_shadow_all.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/intern/cycles/kernel/bvh/bvh_shadow_all.h b/intern/cycles/kernel/bvh/bvh_shadow_all.h index b27afaa9869..1d6fa303d3e 100644 --- a/intern/cycles/kernel/bvh/bvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/bvh_shadow_all.h @@ -254,9 +254,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(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 @@ -283,15 +280,18 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, return true; } /* if maximum number of hits reached, block all light */ - else if(*num_hits >= max_hits) { + else if(*num_hits == max_hits) { 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; } prim_addr++; |