From 99451698d3469f613934ffe2ce33da90dc820e22 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 25 Aug 2016 11:09:06 +0200 Subject: Cycles: Implement proper visibility check in QBVH volume all intersection --- intern/cycles/kernel/bvh/qbvh_volume_all.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'intern/cycles/kernel/bvh/qbvh_volume_all.h') 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) -- cgit v1.2.3