Blender
V3.3
|
#include <build.h>
Public Member Functions | |
BVHBuild (const vector< Object * > &objects, array< int > &prim_type, array< int > &prim_index, array< int > &prim_object, array< float2 > &prim_time, const BVHParams ¶ms, Progress &progress) | |
~BVHBuild () | |
BVHNode * | run () |
Protected Types | |
enum | { THREAD_TASK_SIZE = 4096 } |
Protected Attributes | |
thread_mutex | build_mutex |
vector< Object * > | objects |
vector< BVHReference > | references |
int | num_original_references |
array< int > & | prim_type |
array< int > & | prim_index |
array< int > & | prim_object |
array< float2 > & | prim_time |
bool | need_prim_time |
BVHParams | params |
Progress & | progress |
double | progress_start_time |
size_t | progress_count |
size_t | progress_total |
size_t | progress_original_total |
float | spatial_min_overlap |
enumerable_thread_specific< BVHSpatialStorage > | spatial_storage |
size_t | spatial_free_index |
thread_spin_lock | spatial_spin_lock |
TaskPool | task_pool |
BVHUnaligned | unaligned_heuristic |
Friends | |
class | BVHMixedSplit |
class | BVHObjectSplit |
class | BVHSpatialSplit |
class | BVHBuildTask |
class | BVHSpatialSplitBuildTask |
class | BVHObjectBinning |
CCL_NAMESPACE_BEGIN BVHBuild::BVHBuild | ( | const vector< Object * > & | objects, |
array< int > & | prim_type, | ||
array< int > & | prim_index, | ||
array< int > & | prim_object, | ||
array< float2 > & | prim_time, | ||
const BVHParams & | params, | ||
Progress & | progress | ||
) |
Definition at line 32 of file build.cpp.
References spatial_min_overlap.
|
protected |
Definition at line 148 of file build.cpp.
References ATTR_STD_MOTION_VERTEX_POSITION, Geometry::attributes, bounds(), center, curve, Attribute::data_float3(), BoundBox::empty, AttributeSet::find(), float(), Hair::get_curve(), BoundBox::grow(), Geometry::has_motion_blur(), NULL, Hair::num_curves(), BVHParams::num_motion_curve_steps, params, PRIMITIVE_PACK_SEGMENT, Hair::primitive_type(), references, and BVHParams::use_spatial_split.
Referenced by add_reference_geometry().
|
protected |
Definition at line 355 of file build.cpp.
References add_reference_curves(), add_reference_points(), add_reference_triangles(), center, Geometry::geometry_type, Geometry::HAIR, Geometry::MESH, mesh, Geometry::POINTCLOUD, and Geometry::VOLUME.
Referenced by add_references().
|
protected |
Definition at line 374 of file build.cpp.
References Object::bounds, center, BoundBox::center2(), BoundBox::grow(), and references.
Referenced by add_references().
|
protected |
Definition at line 260 of file build.cpp.
References ATTR_STD_MOTION_VERTEX_POSITION, Geometry::attributes, bounds(), center, Attribute::data_float3(), BoundBox::empty, AttributeSet::find(), float(), PointCloud::get_point(), BoundBox::grow(), Geometry::has_motion_blur(), NULL, BVHParams::num_motion_point_steps, PointCloud::num_points(), params, point, PRIMITIVE_MOTION_POINT, PRIMITIVE_POINT, references, and BVHParams::use_spatial_split.
Referenced by add_reference_geometry().
|
protected |
Definition at line 58 of file build.cpp.
References ATTR_STD_MOTION_VERTEX_POSITION, Geometry::attributes, bounds(), center, Attribute::data_float3(), BoundBox::empty, AttributeSet::find(), float(), Mesh::get_triangle(), BoundBox::grow(), Geometry::has_motion_blur(), mesh, NULL, BVHParams::num_motion_triangle_steps, Mesh::num_triangles(), params, Mesh::primitive_type(), references, Mesh::size, t, BVHParams::use_spatial_split, and verts.
Referenced by add_reference_geometry().
Definition at line 409 of file build.cpp.
References add_reference_geometry(), add_reference_object(), bounds(), center, count_primitives(), BoundBox::empty, Progress::get_cancel(), Object::is_traceable(), objects, params, progress, references, BVHParams::top_level, and zero_float3().
Referenced by run().
|
protected |
Definition at line 681 of file build.cpp.
References BVHRange::bounds(), bounds(), build_node(), BVHObjectBinning, BVHUnaligned::compute_aligned_boundbox(), BVHUnaligned::compute_aligned_space(), create_leaf_node(), BoundBox::half_area(), BVHObjectBinning::leafSAH, left, params, TaskPool::push(), range_within_max_leaf_size(), references, right, BVHParams::sah_node_cost, BVHParams::sah_primitive_cost, BVHNode::set_aligned_space(), BVHRange::size(), size(), BVHParams::small_enough_for_leaf(), BVHObjectBinning::split(), BVHObjectBinning::splitSAH, task_pool, thread_build_node(), THREAD_TASK_SIZE, BVHParams::top_level, BVHObjectBinning::unaligned_bounds(), unaligned_heuristic, BVHParams::unaligned_split_threshold, and BVHParams::use_unaligned_nodes.
|
protected |
Definition at line 765 of file build.cpp.
References BVHRange::bounds(), bounds(), BVHMixedSplit::bounds, BVHMixedSplit, BVHUnaligned::compute_aligned_boundbox(), BVHUnaligned::compute_aligned_space(), create_leaf_node(), Progress::get_cancel(), BoundBox::half_area(), left, BVHMixedSplit::nodeSAH, NULL, params, progress, progress_count, progress_total, progress_update(), TaskPool::push(), references, right, BVHParams::sah_node_cost, BVHParams::sah_primitive_cost, BVHNode::set_aligned_space(), BVHRange::size(), BVHParams::small_enough_for_leaf(), BVHMixedSplit::split(), blender::io::alembic::split(), task_pool, thread_build_spatial_split_node(), THREAD_TASK_SIZE, BVHParams::top_level, unaligned_heuristic, BVHParams::unaligned_split_threshold, and BVHParams::use_unaligned_nodes.
Referenced by build_node(), run(), thread_build_node(), and thread_build_spatial_split_node().
|
protected |
Definition at line 923 of file build.cpp.
References bounds(), BVHNode::bounds, BVHReference::bounds(), BVHRange::bounds(), array< T, alignment >::capacity(), BVHUnaligned::compute_aligned_prim_boundbox(), BVHUnaligned::compute_aligned_space(), create_object_leaf_nodes(), BoundBox::empty, float(), BoundBox::grow(), LeafNode::hi, LeafNode::lo, make_float2, max, merge(), min, need_prim_time, NULL, objects, params, prim_index, BVHReference::prim_index(), prim_object, BVHReference::prim_object(), prim_time, prim_type, BVHReference::prim_type(), PRIMITIVE_ALL, PRIMITIVE_INDEX, PRIMITIVE_NUM, progress, progress_count, progress_total, references, array< T, alignment >::reserve(), array< T, alignment >::resize(), BVHNode::set_aligned_space(), BVHRange::size(), array< T, alignment >::size(), size(), spatial_free_index, spatial_spin_lock, BVHRange::start(), BVHNode::time_from, BVHReference::time_from(), BVHNode::time_to, BVHReference::time_to(), unaligned_heuristic, BVHParams::use_spatial_split, and BVHParams::use_unaligned_nodes.
Referenced by build_node().
|
protected |
Definition at line 886 of file build.cpp.
References bounds(), BVHNode::bounds, BVHReference::bounds(), BoundBox::empty, make_float2, max, min, need_prim_time, objects, prim_index, BVHReference::prim_index(), prim_object, BVHReference::prim_object(), prim_time, prim_type, BVHReference::prim_type(), array< T, alignment >::size(), BVHNode::time_from, BVHReference::time_from(), BVHNode::time_to, and BVHReference::time_to().
Referenced by create_leaf_node().
|
protected |
Definition at line 566 of file build.cpp.
References double(), progress, progress_count, progress_original_total, progress_start_time, progress_total, Progress::set_substatus(), string_printf(), and time_dt().
Referenced by build_node(), and thread_build_node().
|
protected |
Definition at line 626 of file build.cpp.
References max, BVHParams::max_curve_leaf_size, BVHParams::max_motion_curve_leaf_size, BVHParams::max_motion_point_leaf_size, BVHParams::max_motion_triangle_leaf_size, BVHParams::max_point_leaf_size, BVHParams::max_triangle_leaf_size, params, BVHReference::prim_type(), PRIMITIVE_CURVE, PRIMITIVE_MOTION, PRIMITIVE_POINT, PRIMITIVE_TRIANGLE, references, BVHRange::size(), size(), and BVHRange::start().
Referenced by build_node(), and BVHMixedSplit::BVHMixedSplit().
Definition at line 1179 of file build.cpp.
References BVHNode::bounds, Freestyle::c, InnerNode::children, BoundBox::half_area(), BVHNode::is_leaf(), make_float4, merge(), min, node, and swap().
Referenced by rotate().
BVHNode * BVHBuild::run | ( | ) |
Definition at line 466 of file build.cpp.
References add_references(), BVHRange::bounds(), build_node(), BVH_STAT_DEPTH, BVH_STAT_INNER_COUNT, BVH_STAT_LEAF_COUNT, BVH_STAT_NODE_COUNT, BVH_STAT_UNALIGNED_COUNT, array< T, alignment >::capacity(), BVHNode::deleteSubtree(), Progress::get_cancel(), BVHNode::getSubtreeSize(), need_prim_time, NULL, params, prim_index, prim_object, prim_time, prim_type, progress, progress_count, progress_original_total, progress_start_time, progress_total, references, array< T, alignment >::resize(), BoundBox::safe_area(), array< T, alignment >::size(), spatial_free_index, spatial_min_overlap, BVHParams::spatial_split_alpha, spatial_storage, string_human_readable_number(), task_pool, time_dt(), BVHParams::top_level, BVHNode::update_time(), BVHNode::update_visibility(), BVHParams::use_motion_steps(), BVHParams::use_spatial_split, VLOG_WORK, and TaskPool::wait_work().
Referenced by BVH2::build().
|
protected |
Definition at line 581 of file build.cpp.
References build_mutex, build_node(), InnerNode::children, Progress::get_cancel(), lock, node, progress, progress_count, progress_update(), BVHRange::size(), and THREAD_TASK_SIZE.
Referenced by build_node().
|
protected |
Definition at line 606 of file build.cpp.
References build_node(), InnerNode::children, Progress::get_cancel(), node, progress, references, and spatial_storage.
Referenced by build_node().
|
friend |
Definition at line 49 of file build.h.
Referenced by build_node().
|
friend |
Definition at line 54 of file build.h.
Referenced by build_node().
|
friend |
|
friend |
|
protected |
Definition at line 84 of file build.h.
Referenced by thread_build_node().
|
protected |
Definition at line 104 of file build.h.
Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().
Definition at line 94 of file build.h.
Referenced by add_references(), create_leaf_node(), create_object_leaf_nodes(), and BVHSpatialSplit::split_reference().
|
protected |
Definition at line 107 of file build.h.
Referenced by add_reference_curves(), add_reference_points(), add_reference_triangles(), add_references(), build_node(), BVHMixedSplit::BVHMixedSplit(), BVHObjectSplit::BVHObjectSplit(), BVHSpatialSplit::BVHSpatialSplit(), create_leaf_node(), range_within_max_leaf_size(), run(), BVHSpatialSplit::split(), and BVHMixedSplit::split().
|
protected |
Definition at line 100 of file build.h.
Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().
|
protected |
Definition at line 101 of file build.h.
Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().
Definition at line 102 of file build.h.
Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().
|
protected |
Definition at line 99 of file build.h.
Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().
|
protected |
Definition at line 110 of file build.h.
Referenced by add_references(), build_node(), create_leaf_node(), progress_update(), run(), thread_build_node(), and thread_build_spatial_split_node().
|
protected |
Definition at line 112 of file build.h.
Referenced by build_node(), create_leaf_node(), progress_update(), run(), and thread_build_node().
|
protected |
Definition at line 114 of file build.h.
Referenced by progress_update(), and run().
|
protected |
Definition at line 111 of file build.h.
Referenced by progress_update(), and run().
|
protected |
Definition at line 113 of file build.h.
Referenced by build_node(), create_leaf_node(), progress_update(), and run().
|
protected |
Definition at line 95 of file build.h.
Referenced by add_reference_curves(), add_reference_object(), add_reference_points(), add_reference_triangles(), add_references(), build_node(), create_leaf_node(), range_within_max_leaf_size(), run(), and thread_build_spatial_split_node().
|
protected |
Definition at line 119 of file build.h.
Referenced by create_leaf_node(), and run().
|
protected |
Definition at line 117 of file build.h.
Referenced by BVHBuild(), BVHMixedSplit::BVHMixedSplit(), and run().
|
protected |
Definition at line 120 of file build.h.
Referenced by create_leaf_node().
|
protected |
Definition at line 118 of file build.h.
Referenced by run(), and thread_build_spatial_split_node().
|
protected |
Definition at line 123 of file build.h.
Referenced by build_node(), and run().
|
protected |
Definition at line 126 of file build.h.
Referenced by build_node(), and create_leaf_node().