diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-10 10:19:40 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-10 10:21:02 +0300 |
commit | 5a618ab737225869555bb9782265a90f7ca2c373 (patch) | |
tree | 0b6d5f9d385f6266bb409aedf3cee36c203e6722 /intern/cycles/bvh/bvh.cpp | |
parent | de3c1657132b404d8611134c24894f7157665c29 (diff) |
Cycles: De-duplicate trace-time object visibility calculation
We already have enough files to worry about in BVH builders. no need to add yet
another copy-paste code which is tempting to be running out of sync.
Diffstat (limited to 'intern/cycles/bvh/bvh.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp index c7e11539cf9..0ad3c8a7429 100644 --- a/intern/cycles/bvh/bvh.cpp +++ b/intern/cycles/bvh/bvh.cpp @@ -153,7 +153,6 @@ void BVH::pack_primitives() if(pack.prim_index[i] != -1) { int tob = pack.prim_object[i]; Object *ob = objects[tob]; - if((pack.prim_type[i] & PRIMITIVE_ALL_TRIANGLE) != 0) { pack_triangle(i, (float4*)&pack.prim_tri_verts[3 * prim_triangle_index]); pack.prim_tri_index[i] = 3 * prim_triangle_index; @@ -162,15 +161,10 @@ void BVH::pack_primitives() else { pack.prim_tri_index[i] = -1; } - - pack.prim_visibility[i] = ob->visibility; - - if(pack.prim_type[i] & PRIMITIVE_ALL_CURVE) + pack.prim_visibility[i] = ob->visibility_for_tracing(); + if(pack.prim_type[i] & PRIMITIVE_ALL_CURVE) { pack.prim_visibility[i] |= PATH_RAY_CURVE; - if (ob->is_shadow_catcher) - pack.prim_visibility[i] &= ~PATH_RAY_SHADOW_NON_CATCHER; - else - pack.prim_visibility[i] &= ~PATH_RAY_SHADOW_CATCHER; + } } else { pack.prim_tri_index[i] = -1; |