diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-01-12 18:54:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-01-12 18:54:08 +0300 |
commit | 76a4cf1941ef0f1e8ca2dd641fb94703dce5a9b0 (patch) | |
tree | 0b00e23e25ee2df1299d832e1d7b294a807796c9 /intern/cycles/bvh/bvh_build.cpp | |
parent | 0421ae056d8ebb7e10894e39d86334b41c061f39 (diff) |
Cycles: Use separate limit for motion primitives for BVH node limits
This way we can have different limits for regular and motion curves
which we'll do in one of the upcoming commits in order to gain some
percents of speedup.
The reasoning here is that motion curves are usually intersecting
lots of others bounding boxes, which makes it inefficient to have
single primitive in the leaf node.
Diffstat (limited to 'intern/cycles/bvh/bvh_build.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index d283cdaf9d7..48f1d063fd1 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -435,6 +435,7 @@ bool BVHBuild::range_within_max_leaf_size(const BVHRange& range, return false; size_t num_triangles = 0; + size_t num_motion_triangles = 0; size_t num_curves = 0; size_t num_motion_curves = 0; @@ -445,13 +446,16 @@ bool BVHBuild::range_within_max_leaf_size(const BVHRange& range, num_curves++; if(ref.prim_type() & PRIMITIVE_MOTION_CURVE) num_motion_curves++; - else if(ref.prim_type() & PRIMITIVE_ALL_TRIANGLE) + else if(ref.prim_type() & PRIMITIVE_TRIANGLE) num_triangles++; + else if(ref.prim_type() & PRIMITIVE_MOTION_TRIANGLE) + num_motion_triangles++; } return (num_triangles <= params.max_triangle_leaf_size) && + (num_motion_triangles <= params.max_motion_triangle_leaf_size) && (num_curves <= params.max_curve_leaf_size) && - (num_motion_curves <= params.max_curve_leaf_size); + (num_motion_curves <= params.max_motion_curve_leaf_size); } /* multithreaded binning builder */ |