本文整理汇总了C++中Split::sah方法的典型用法代码示例。如果您正苦于以下问题:C++ Split::sah方法的具体用法?C++ Split::sah怎么用?C++ Split::sah使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Split
的用法示例。
在下文中一共展示了Split::sah方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parent
__forceinline BVH2Builder<Heuristic>::ParallelSplitTask::ParallelSplitTask(const TaskScheduler::ThreadInfo& thread, BVH2Builder* parent, BVH2::Base*& node, size_t depth,
atomic_set<PrimRefBlock>& prims, const PrimInfo& pinfo, const Split& split)
: parent(parent), dst(node), depth(depth), split(split)
{
/*! compute leaf and split cost */
const float leafSAH = parent->trity.intCost*pinfo.sah();
const float splitSAH = BVH2::travCost*halfArea(pinfo.geomBounds)+parent->trity.intCost*split.sah();
assert(atomic_set<PrimRefBlock>::block_iterator_unsafe(prims).size() == pinfo.size());
assert(leafSAH >= 0 && splitSAH >= 0);
/*! create a leaf node when threshold reached or SAH tells us to stop */
if (pinfo.size() <= 1 || depth > BVH2::maxDepth || (pinfo.size() <= parent->bvh->maxLeafTris && leafSAH <= splitSAH)) {
dst = parent->createLeaf(thread,prims,pinfo); delete this; return;
}
/*! start parallel splitting */
new (&splitter) MultiThreadedSplitterNormal(thread,
&parent->alloc,parent->triangles,parent->vertices,prims,pinfo,split,
(TaskScheduler::completeFunction)_createNode,this);
}