8-Wide BVH¶
This is a fast, vectorized implementation of a SAH-based 8-wide BVH, targetting hybrid (ray- and cone-tracing) workloads. Several optimizations that target cone tracing are implemented [Emre et al., 2025].
-
class bvh8w_t : public wt::ads::ads_t¶
-
Public Functions
-
inline bvh8w_t(std::vector<node_t> nodes, std::vector<leaf_node_t> leaf_nodes, tris_vectorized_data_t vectorized_data, std::vector<tri_t> tris, const aabb_t &world, f_t sah_cost, f_t occupancy, std::size_t max_depth) noexcept¶
-
inline virtual std::size_t nodes_count() const noexcept override¶
-
inline const auto &vectorized_tri_data() const noexcept¶
-
inline const std::int32_t root_ptr() const noexcept¶
-
inline const leaf_node_t &leaf_node(idx_t nidx) const noexcept¶
-
virtual intersection_record_t intersect(const ball_t &ball, const intersect_opts_t &opts = intersect_opts_t::defaults()) const noexcept override¶
Intersects the ADS with ball, returning the intersection record and contained primitives.
-
virtual intersection_record_t intersect(const ray_t &ray, const pqrange_t<> range = {0 * u::m, limits<length_t>::infinity()}) const noexcept override¶
Intersects the ADS with a ray, returning the intersection record with the intersected primitive.
- Parameters:
range – traversal bounds
z_search_range_scale – scaler for z-axis search range
-
virtual intersection_record_t intersect(const elliptic_cone_t &cone, const pqrange_t<> range = {0 * u::m, limits<length_t>::infinity()}, const intersect_opts_t &opts = intersect_opts_t::defaults()) const noexcept override¶
Intersects the ADS with a cone, returning the intersection record and contained primitives. Once the closest intersection is found, looks for triangles within a z distance from the closest point. This distance is computed as the cone major axis length time ‘z_search_range_scale’.
- Parameters:
range – traversal bounds
z_search_range_scale – scaler for z-axis search range
-
virtual bool shadow(const ray_t &ray, const pqrange_t<> range) const noexcept override¶
Intersects the ADS with a ray. Returns TRUE if a hit was found.
- Parameters:
traversal_mode – traversal mode (front/back/font-and-back faces)
range – traversal bounds
-
virtual bool shadow(const elliptic_cone_t &cone, const pqrange_t<> range) const noexcept override¶
Intersects the ADS with a cone. Returns TRUE if a hit was found.
- Parameters:
range – traversal bounds
Friends
- friend class construction::bvh8w_constructor_t
-
struct tris_vectorized_data_t¶
Public Members
-
inline bvh8w_t(std::vector<node_t> nodes, std::vector<leaf_node_t> leaf_nodes, tris_vectorized_data_t vectorized_data, std::vector<tri_t> tris, const aabb_t &world, f_t sah_cost, f_t occupancy, std::size_t max_depth) noexcept¶
-
class bvh8w_constructor_t : public wt::ads::construction::ads_constructor_t¶
Constructs an 8-wide SAH BVH.