On shader changes, make sure these are uploaded in the cases where an expensive object rebuild isn't required #6
@ -435,19 +435,24 @@ void GeometryManager::device_update_preprocess(Device *device, Scene *scene, Pro
|
|||||||
/* Re-create volume mesh if we will rebuild or refit the BVH. Note we
|
/* Re-create volume mesh if we will rebuild or refit the BVH. Note we
|
||||||
* should only do it in that case, otherwise the BVH and mesh can go
|
* should only do it in that case, otherwise the BVH and mesh can go
|
||||||
* out of sync. */
|
* out of sync. */
|
||||||
if (geom->is_modified() && geom->geometry_type == Geometry::VOLUME) {
|
if (geom->is_volume()) {
|
||||||
/* Create volume meshes if there is voxel data. */
|
if (geom->need_update_rebuild) {
|
||||||
if (!volume_images_updated) {
|
/* Create volume meshes if there is voxel data. */
|
||||||
progress.set_status("Updating Meshes Volume Bounds");
|
if (!volume_images_updated) {
|
||||||
device_update_volume_images(device, scene, progress);
|
progress.set_status("Updating Meshes Volume Bounds");
|
||||||
volume_images_updated = true;
|
device_update_volume_images(device, scene, progress);
|
||||||
|
volume_images_updated = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Volume *volume = static_cast<Volume *>(geom);
|
||||||
|
create_volume_mesh(scene, volume, progress);
|
||||||
|
|
||||||
|
/* always reallocate when we have a volume, as we need to rebuild the BVH */
|
||||||
|
device_update_flags |= DEVICE_MESH_DATA_NEEDS_REALLOC;
|
||||||
|
}
|
||||||
|
else if (geom->is_modified()) {
|
||||||
|
device_update_flags |= DEVICE_MESH_DATA_MODIFIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
Volume *volume = static_cast<Volume *>(geom);
|
|
||||||
create_volume_mesh(scene, volume, progress);
|
|
||||||
|
|
||||||
/* always reallocate when we have a volume, as we need to rebuild the BVH */
|
|
||||||
device_update_flags |= DEVICE_MESH_DATA_NEEDS_REALLOC;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geom->is_hair()) {
|
if (geom->is_hair()) {
|
||||||
|
@ -265,4 +265,13 @@ openvdb::GridBase::ConstPtr VDBImageLoader::get_grid()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int VDBImageLoader::get_precision() const
|
||||||
|
{
|
||||||
|
#ifdef WITH_NANOVDB
|
||||||
|
return precision;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
@ -40,6 +40,8 @@ class VDBImageLoader : public ImageLoader {
|
|||||||
|
|
||||||
virtual bool is_vdb_loader() const override;
|
virtual bool is_vdb_loader() const override;
|
||||||
|
|
||||||
|
int get_precision() const;
|
||||||
|
|
||||||
#ifdef WITH_OPENVDB
|
#ifdef WITH_OPENVDB
|
||||||
openvdb::GridBase::ConstPtr get_grid();
|
openvdb::GridBase::ConstPtr get_grid();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user