52 string msg =
"Updating Geometry BVH ";
64 object.set_is_shadow_catcher(
true);
65 object.set_visibility(~0);
67 object.set_geometry(
this);
70 geometry.push_back(
this);
72 objects.push_back(&
object);
89 params->use_bvh_unaligned_nodes;
112 progress.
set_status(
"Updating Scene BVH",
"Building");
120 scene->params.use_bvh_unaligned_nodes;
124 bparams.
bvh_type = scene->params.bvh_type;
129 const bool can_refit = scene->bvh !=
nullptr &&
130 (bparams.
bvh_layout == BVHLayout::BVH_LAYOUT_OPTIX ||
131 bparams.
bvh_layout == BVHLayout::BVH_LAYOUT_METAL);
133 BVH *bvh = scene->bvh;
135 bvh = scene->bvh =
BVH::create(bparams, scene->geometry, scene->objects, device);
138 device->
build_bvh(bvh, progress, can_refit);
147 if (has_bvh2_layout) {
148 pack = std::move(
static_cast<BVH2 *
>(bvh)->pack);
155 progress.
set_status(
"Updating Scene BVH",
"Copying BVH to device");
194 dscene->
data.bvh.use_bvh_steps = (scene->params.num_bvh_time_steps != 0);
195 dscene->
data.bvh.curve_subdivisions = scene->params.curve_subdivisions();
197 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
virtual void replace_geometry(const vector< Geometry * > &geometry, const vector< Object * > &objects)
static 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(uint kernel_features) const =0
void device_update_bvh(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
void compute_bvh(Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, size_t n, size_t total)
virtual void compute_bounds()=0
bool need_update_bvh_for_offset
bool need_build_bvh(BVHLayout layout) const
void set_status(const string &status_, const string &substatus_="")
void steal_data(array< T > &from)
#define CCL_NAMESPACE_END
#define MEM_GUARDED_CALL(progress, func,...)
CCL_NAMESPACE_BEGIN typedef KernelBVHLayout BVHLayout
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
array< uint > prim_visibility
array< float2 > prim_time