GPU-based SAH BVH builder.
GPU-based SAH BVH builder.
This builders provides the context to generate a bounding volume hierarchy using the Surface Area Heuristic out of a generic set of unsorted bounding boxes. 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.
The following code snippet shows how to use this builder:
#include <nih/bvh/cuda/sah_builder.h>
thrust::device_vector<Bbox4f> bboxes;
...
thrust::device_vector<Bvh_node> bvh_nodes;
thrust::device_vector<uint2> bvh_leaves;
thrust::device_vector<uint32> bvh_index;
builder.build(
Bbox3f( Vector3f(0.0f), Vector3f(1.0f) ),
bboxes.begin(),
bboxes.end(),
4 );
|
| Sah_builder (thrust::device_vector< Bvh_node > &nodes, thrust::device_vector< uint2 > &leaves, thrust::device_vector< uint32 > &index) |
| constructor
|
|
template<typename Iterator > |
void | build (const uint32 BINS, const Bbox3f bbox, const Iterator bbox_begin, const Iterator bbox_end, const uint32 max_leaf_size, const float max_cost=1.8f) |
| build a bvh given a set of bboxes
|
|
| Sah_builder (thrust::device_vector< Bvh_node > &nodes, thrust::device_vector< uint2 > &leaves, thrust::device_vector< uint32 > &index) |
|
template<typename Iterator > |
void | build (const Bbox3f bbox, const Iterator bbox_begin, const Iterator bbox_end, const uint32 max_leaf_size, const float max_cost=1.8f) |
|
|
thrust::device_vector< Bvh_node > * | m_nodes |
|
thrust::device_vector< uint2 > * | m_leaves |
|
thrust::device_vector< uint32 > * | m_index |
|
uint32 | m_levels [128] |
|
uint32 | m_level_count |
|
Bbox3f | m_bbox |
|
uint32 | m_node_count |
|
uint32 | m_leaf_count |
|
float | m_init_bins_time |
|
float | m_update_bins_time |
|
float | m_sah_split_time |
|
float | m_distribute_objects_time |
|
thrust::device_vector< float3 > | m_bin_bmin |
|
thrust::device_vector< float3 > | m_bin_bmax |
|
thrust::device_vector< int32 > | m_bin_size |
|
thrust::device_vector< Bin > | m_queue_bins |
|
thrust::device_vector< Split > | m_queue_splits |
|
thrust::device_vector< uint32 > | m_queue_offsets |
|
thrust::device_vector< int4 > | m_bin_ids |
|
thrust::device_vector< int32 > | m_split_ids |
|
thrust::device_vector< int32 > | m_node_ids |
|
thrust::device_vector< uint32 > | m_new_pos |
|
thrust::device_vector< uint32 > | m_counters |
|
float | m_sorting_time |
|
float | m_compression_time |
|
uint32 | m_temp_storage |
|