diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-04-22 18:54:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-04-22 19:15:41 +0400 |
commit | 6974b69c61729cc80a72d78f02eb137c5097b129 (patch) | |
tree | 85642f54fffafae4f8df5129d3651292bae8a12c /intern/cycles/bvh/bvh_split.h | |
parent | 2108a616910dc814be13a0b640970bfe4b7eb4ce (diff) |
Cycles: optimization for hair BVH build, allow max 2 hair curves per leaf.
This gives me 14% reduction in render time for koro_final.blend.
Diffstat (limited to 'intern/cycles/bvh/bvh_split.h')
-rw-r--r-- | intern/cycles/bvh/bvh_split.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/bvh/bvh_split.h b/intern/cycles/bvh/bvh_split.h index 1f4befbe8e2..5b739311e5f 100644 --- a/intern/cycles/bvh/bvh_split.h +++ b/intern/cycles/bvh/bvh_split.h @@ -77,7 +77,7 @@ public: /* find split candidates. */ float area = range.bounds().safe_area(); - leafSAH = area * builder->params.triangle_cost(range.size()); + leafSAH = area * builder->params.primitive_cost(range.size()); nodeSAH = area * builder->params.node_cost(2); object = BVHObjectSplit(builder, range, nodeSAH); @@ -92,7 +92,7 @@ public: /* leaf SAH is the lowest => create leaf. */ minSAH = min(min(leafSAH, object.sah), spatial.sah); - no_split = (minSAH == leafSAH && range.size() <= builder->params.max_leaf_size); + no_split = (minSAH == leafSAH && builder->range_within_max_leaf_size(range)); } __forceinline void split(BVHBuild *builder, BVHRange& left, BVHRange& right, const BVHRange& range) |