Fermat
Public Types | Public Methods | Public Members | List of all members
cugar::cuda::LBVH_builder< integer, bvh_node_type, node_vector, range_vector, index_vector > Struct Template Reference

Detailed description

template<typename integer, typename bvh_node_type = Bvh_node, typename node_vector = vector<device_tag,bvh_node_type>, typename range_vector = vector<device_tag,uint2>, typename index_vector = vector<device_tag,uint32>>
struct cugar::cuda::LBVH_builder< integer, bvh_node_type, node_vector, range_vector, index_vector >

GPU-based Linear BVH builder

This class provides the context to generate LBVHs on the GPU starting from a set of unordered points. The output is a set of nodes with the corresponding leaves and a set of primitive indices into the input set of points. The output leaves will specify contiguous ranges into this index.

Template Parameters
integeran integer type that determines the number of bits used to compute the points' Morton codes. Accepted values are uint32 and uint64.

The following code snippet shows how to use this builder:

thrust::device_vector<Vector3f> points;
... // code to fill the input vector of points
thrust::device_vector<Bvh_node> bvh_nodes;
thrust::device_vector<uint32> bvh_index;
cugar::cuda::LBVH_builder<uint64> builder( &bvh_nodes, &bvh_index );
builder.build(
Bbox3f( Vector3f(0.0f), Vector3f(1.0f) ), // suppose all bboxes are in [0,1]^3
points.begin(), // begin iterator
points.end(), // end iterator
4 ); // target 4 objects per leaf

#include <lbvh_builder.h>

Public Types

typedef LBVH_builder_stats Stats
 

Public Methods

 LBVH_builder (node_vector *nodes=NULL, index_vector *index=NULL, range_vector *leaf_ranges=NULL, index_vector *leaf_pointers=NULL, index_vector *parents=NULL, index_vector *skip_nodes=NULL, range_vector *node_ranges=NULL)
 
void set_nodes (node_vector *nodes)
 
void set_index (index_vector *index)
 
void set_parents (index_vector *parents)
 
void set_skip_nodes (index_vector *skip_nodes)
 
void set_leaf_pointers (index_vector *leaf_pointers)
 
void set_leaf_ranges (range_vector *leaf_ranges)
 
void set_node_ranges (range_vector *node_ranges)
 
template<typename Iterator >
void build (const Bbox3f bbox, const Iterator points_begin, const Iterator points_end, const uint32 max_leaf_size, Stats *stats=NULL)
 

Public Members

node_vector * m_nodes
 
range_vector * m_node_ranges
 
range_vector * m_leaf_ranges
 
index_vector * m_leaf_pointers
 
index_vector * m_parents
 
index_vector * m_skip_nodes
 
index_vector * m_index
 
caching_device_vector< integer > m_codes
 
caching_device_vector< integer > m_temp_codes
 
caching_device_vector< uint32 > m_temp_index
 
Bbox3f m_bbox
 
uint32 m_node_count
 
uint32 m_leaf_count
 
cuda::Radixtree_context m_kd_context
 

Constructor & Destructor Documentation

◆ LBVH_builder()

template<typename integer, typename bvh_node_type = Bvh_node, typename node_vector = vector<device_tag,bvh_node_type>, typename range_vector = vector<device_tag,uint2>, typename index_vector = vector<device_tag,uint32>>
cugar::cuda::LBVH_builder< integer, bvh_node_type, node_vector, range_vector, index_vector >::LBVH_builder ( node_vector *  nodes = NULL,
index_vector *  index = NULL,
range_vector *  leaf_ranges = NULL,
index_vector *  leaf_pointers = NULL,
index_vector *  parents = NULL,
index_vector *  skip_nodes = NULL,
range_vector *  node_ranges = NULL 
)
inline

constructor

Parameters
nodesoutput nodes array
leavesoutput leaf array
indexoutput index array

Member Function Documentation

◆ build()

template<typename integer , typename bvh_node_type , typename node_vector , typename range_vector , typename index_vector >
template<typename Iterator >
void cugar::cuda::LBVH_builder< integer, bvh_node_type, node_vector, range_vector, index_vector >::build ( const Bbox3f  bbox,
const Iterator  points_begin,
const Iterator  points_end,
const uint32  max_leaf_size,
Stats stats = NULL 
)

build a bvh given a set of points that will be reordered in-place

Parameters
bboxglobal bbox
points_beginbeginning of the point sequence to sort
points_endend of the point sequence to sort
max_leaf_sizemaximum leaf size

The documentation for this struct was generated from the following files: