Fermat
Classes | Functions
Bounding Volume Hierarchies

Detailed Description

Classes

struct  cugar::Bvh< DIM >
 
class  cugar::Bvh_builder< DIM >
 
struct  cugar::Bvh_node_3d_bbox_iterator
 
struct  cugar::Bvh_node
 
struct  cugar::Bvh_node_3d
 
class  cugar::Bvh_sah_builder
 
struct  nih::cuda::Binned_sah_builder
 
struct  cugar::cuda::LBVH_builder_stats
 
struct  cugar::cuda::LBVH_builder< integer, bvh_node_type, node_vector, range_vector, index_vector >
 
struct  cugar::cuda::bvh_packing_functor
 
struct  nih::cuda::Sah_builder
 GPU-based SAH BVH builder. More...
 

Functions

float cugar::compute_sah_cost (const Bvh< 3 > &bvh, uint32 node_index=0)
 compute SAH cost of a subtree
 
void cugar::build_skip_nodes (const Bvh_node *nodes, uint32 *skip_nodes)
 build skip nodes for a tree
 
template<typename Node_iterator , typename Bbox_iterator , typename Output_iterator >
void cugar::cuda::pack (const uint32 n_nodes, Node_iterator nodes, Bbox_iterator bboxes, Output_iterator packed_nodes)
 

Function Documentation

◆ pack()

template<typename Node_iterator , typename Bbox_iterator , typename Output_iterator >
void cugar::cuda::pack ( const uint32  n_nodes,
Node_iterator  nodes,
Bbox_iterator  bboxes,
Output_iterator  packed_nodes 
)

Pack a set of 3d bvh nodes and their bboxes into a single set of (4d) bboxes, where the 3rd components of the bbox min and max are used to pack the tree topology. The input and output bbox arrays can be the same.

Parameters
n_nodesnode count
nodesinput nodes
bboxesinput bboxes
packed_nodesoutput bboxes

The following code snipped illustrates an example usage:

thrust::device_vector<Bvh_node> bvh_nodes;
thrust::device_vector<Bbox4f> bvh_bboxes;
uint32 node_count;
... // build a bvh and compute its bboxes here
// pack the bvh
node_count,
bvh_nodes.begin(),
bvh_bboxes.begin(),
bvh_bboxes.begin() );