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
-
integer | an 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;
...
thrust::device_vector<Bvh_node> bvh_nodes;
thrust::device_vector<uint32> bvh_index;
builder.build(
Bbox3f( Vector3f(0.0f), Vector3f(1.0f) ),
points.begin(),
points.end(),
4 );
|
| 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) |
|
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
-
nodes | output nodes array |
leaves | output leaf array |
index | output index array |
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
-
bbox | global bbox |
points_begin | beginning of the point sequence to sort |
points_end | end of the point sequence to sort |
max_leaf_size | maximum leaf size |