42 string msg =
"Updating Geometry BVH ";
54 object.set_is_shadow_catcher(
true);
55 object.set_visibility(~0);
57 object.set_geometry(
this);
60 geometry.push_back(
this);
62 objects.push_back(&
object);
67 bvh->replace_geometry(geometry, objects);
79 params->use_bvh_unaligned_nodes;
101 progress.
set_status(
"Updating Scene BVH",
"Building");
122 BVH *bvh = scene->
bvh.get();
123 if (bvh ==
nullptr) {
125 bvh = scene->
bvh.get();
128 device->
build_bvh(bvh, progress, can_refit);
137 if (has_bvh2_layout) {
138 pack = std::move(
static_cast<BVH2 *
>(bvh)->pack);
145 progress.
set_status(
"Updating Scene BVH",
"Copying BVH to device");
189 dscene->
data.device_bvh =
nullptr;
191 dscene->
data.device_bvh = 0;
CCL_NAMESPACE_BEGIN const char * bvh_layout_name(BVHLayout layout)
int num_motion_triangle_steps
static BVHLayout best_bvh_layout(BVHLayout requested_layout, BVHLayoutMask supported_layouts)
bool use_compact_structure
int num_motion_point_steps
int num_motion_curve_steps
static unique_ptr< BVH > create(const BVHParams ¶ms, const vector< Geometry * > &geometry, const vector< Object * > &objects, Device *device)
device_vector< float2 > prim_time
device_vector< uint > prim_visibility
device_vector< int > object_node
device_vector< int > prim_object
device_vector< int4 > bvh_leaf_nodes
device_vector< int > prim_type
device_vector< int4 > bvh_nodes
device_vector< int > prim_index
virtual void build_bvh(BVH *bvh, Progress &progress, bool refit)
virtual BVHLayoutMask get_bvh_layout_mask(const uint kernel_features) const =0
void device_update_bvh(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
virtual void compute_bounds()=0
bool need_update_bvh_for_offset
bool need_build_bvh(BVHLayout layout) const
void compute_bvh(Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, const size_t n, size_t total)
void set_status(const string &status_, const string &substatus_="")
bool use_bvh_unaligned_nodes
bool use_bvh_spatial_split
void steal_data(array< T > &from)
#define CCL_NAMESPACE_END
#define MEM_GUARDED_CALL(progress, func,...)
KernelBVHLayout BVHLayout
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
array< uint > prim_visibility
array< float2 > prim_time
unique_ptr_vector< Geometry > geometry
unique_ptr_vector< Object > objects