Open CASCADE Technology  7.1.0.beta
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

BVH_LinearBuilder< T, N > Class Template Reference

Performs fast BVH construction using LBVH building approach. Algorithm uses spatial Morton codes to reduce the BVH construction problem to a sorting problem (radix sort – O(N) complexity). This Linear Bounding Volume Hierarchy (LBVH) builder produces BVH trees of lower quality compared to SAH-based BVH builders but it is over an order of magnitude faster (up to 3M triangles per second). More...

#include <BVH_LinearBuilder.hxx>

Inheritance diagram for BVH_LinearBuilder< T, N >:
Inheritance graph
[legend]

Public Types

typedef BVH::VectorType< T, N >::Type BVH_VecNt
 

Public Member Functions

 BVH_LinearBuilder (const Standard_Integer theLeafNodeSize=5, const Standard_Integer theMaxTreeDepth=32)
 Creates binned LBVH builder. More...
 
virtual ~BVH_LinearBuilder ()
 Releases resources of LBVH builder. More...
 
void Build (BVH_Set< T, N > *theSet, BVH_Tree< T, N > *theBVH, const BVH_Box< T, N > &theBox)
 Builds BVH. More...
 
- Public Member Functions inherited from BVH_Builder< T, N >
 BVH_Builder (const Standard_Integer theLeafNodeSize, const Standard_Integer theMaxTreeDepth)
 Creates new abstract BVH builder. More...
 
virtual ~BVH_Builder ()
 Releases resources of BVH builder. More...
 

Protected Types

typedef NCollection_Array1< BVH_EncodedLink >::iterator LinkIterator
 

Protected Member Functions

Standard_Integer EmitHierachy (BVH_Tree< T, N > *theBVH, const Standard_Integer theBit, const Standard_Integer theShift, const Standard_Integer theStart, const Standard_Integer theFinal)
 Emits hierarchy from sorted Morton codes. More...
 
Standard_Integer LowerBound (Standard_Integer theStart, Standard_Integer theFinal, Standard_Integer theDigit)
 Returns index of the first element which does not compare less than the given one. More...
 
- Protected Member Functions inherited from BVH_Builder< T, N >
void UpdateDepth (BVH_Tree< T, N > *theBVH, const Standard_Integer theLevel)
 Updates depth of constructed BVH tree. More...
 

Protected Attributes

NCollection_Handle< BVH_RadixSorter< T, N > > myRadixSorter
 Tool object to perform radix sort of BVH primitives. More...
 
- Protected Attributes inherited from BVH_Builder< T, N >
Standard_Integer myMaxTreeDepth
 Maximum depth of constructed BVH. More...
 
Standard_Integer myLeafNodeSize
 Maximum number of objects per leaf. More...
 

Detailed Description

template<class T, int N>
class BVH_LinearBuilder< T, N >

Performs fast BVH construction using LBVH building approach. Algorithm uses spatial Morton codes to reduce the BVH construction problem to a sorting problem (radix sort – O(N) complexity). This Linear Bounding Volume Hierarchy (LBVH) builder produces BVH trees of lower quality compared to SAH-based BVH builders but it is over an order of magnitude faster (up to 3M triangles per second).

For more details see: C. Lauterbach, M. Garland, S. Sengupta, D. Luebke, and D. Manocha. Fast BVH construction on GPUs. Eurographics, 2009.

Member Typedef Documentation

template<class T , int N>
typedef BVH::VectorType<T, N>::Type BVH_LinearBuilder< T, N >::BVH_VecNt
template<class T , int N>
typedef NCollection_Array1<BVH_EncodedLink>::iterator BVH_LinearBuilder< T, N >::LinkIterator
protected

Constructor & Destructor Documentation

template<class T , int N>
BVH_LinearBuilder< T, N >::BVH_LinearBuilder ( const Standard_Integer  theLeafNodeSize = 5,
const Standard_Integer  theMaxTreeDepth = 32 
)

Creates binned LBVH builder.

template<class T , int N>
virtual BVH_LinearBuilder< T, N >::~BVH_LinearBuilder ( )
virtual

Releases resources of LBVH builder.

Member Function Documentation

template<class T , int N>
void BVH_LinearBuilder< T, N >::Build ( BVH_Set< T, N > *  theSet,
BVH_Tree< T, N > *  theBVH,
const BVH_Box< T, N > &  theBox 
)
virtual

Builds BVH.

Implements BVH_Builder< T, N >.

template<class T , int N>
Standard_Integer BVH_LinearBuilder< T, N >::EmitHierachy ( BVH_Tree< T, N > *  theBVH,
const Standard_Integer  theBit,
const Standard_Integer  theShift,
const Standard_Integer  theStart,
const Standard_Integer  theFinal 
)
protected

Emits hierarchy from sorted Morton codes.

template<class T , int N>
Standard_Integer BVH_LinearBuilder< T, N >::LowerBound ( Standard_Integer  theStart,
Standard_Integer  theFinal,
Standard_Integer  theDigit 
)
protected

Returns index of the first element which does not compare less than the given one.

Field Documentation

template<class T , int N>
NCollection_Handle<BVH_RadixSorter<T, N> > BVH_LinearBuilder< T, N >::myRadixSorter
protected

Tool object to perform radix sort of BVH primitives.


The documentation for this class was generated from the following file: