diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-08-25 12:09:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-08-25 12:09:06 +0300 |
commit | 99451698d3469f613934ffe2ce33da90dc820e22 (patch) | |
tree | 04175bc8e575917a57840df95edf4c03d5eb1dbd /intern/cycles | |
parent | 29c733e6f2dd779153fe49d94b0f3de41c58b030 (diff) |
Cycles: Implement proper visibility check in QBVH volume all intersection
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/bvh/qbvh_volume_all.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/kernel/bvh/qbvh_volume_all.h b/intern/cycles/kernel/bvh/qbvh_volume_all.h index 4d3028b37bf..ab4b70085e8 100644 --- a/intern/cycles/kernel/bvh/qbvh_volume_all.h +++ b/intern/cycles/kernel/bvh/qbvh_volume_all.h @@ -240,6 +240,14 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, /* If node is leaf, fetch triangle list. */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); + + if((__float_as_uint(leaf.z) & visibility) == 0) { + /* Pop. */ + node_addr = traversal_stack[stack_ptr].addr; + --stack_ptr; + continue; + } + int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) |