diff options
Diffstat (limited to 'intern/cycles/scene/scene.cpp')
-rw-r--r-- | intern/cycles/scene/scene.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/intern/cycles/scene/scene.cpp b/intern/cycles/scene/scene.cpp index 4230abe9a1b..1963ebbbb19 100644 --- a/intern/cycles/scene/scene.cpp +++ b/intern/cycles/scene/scene.cpp @@ -30,6 +30,7 @@ #include "scene/object.h" #include "scene/osl.h" #include "scene/particles.h" +#include "scene/pointcloud.h" #include "scene/procedural.h" #include "scene/scene.h" #include "scene/shader.h" @@ -64,11 +65,14 @@ DeviceScene::DeviceScene(Device *device) curve_keys(device, "__curve_keys", MEM_GLOBAL), curve_segments(device, "__curve_segments", MEM_GLOBAL), patches(device, "__patches", MEM_GLOBAL), + points(device, "__points", MEM_GLOBAL), + points_shader(device, "__points_shader", MEM_GLOBAL), objects(device, "__objects", MEM_GLOBAL), object_motion_pass(device, "__object_motion_pass", MEM_GLOBAL), object_motion(device, "__object_motion", MEM_GLOBAL), object_flag(device, "__object_flag", MEM_GLOBAL), object_volume_step(device, "__object_volume_step", MEM_GLOBAL), + object_prim_offset(device, "__object_prim_offset", MEM_GLOBAL), camera_motion(device, "__camera_motion", MEM_GLOBAL), attributes_map(device, "__attributes_map", MEM_GLOBAL), attributes_float(device, "__attributes_float", MEM_GLOBAL), @@ -312,6 +316,12 @@ void Scene::device_update(Device *device_, Progress &progress) if (progress.get_cancel() || device->have_error()) return; + progress.set_status("Updating Primitive Offsets"); + object_manager->device_update_prim_offsets(device, &dscene, this); + + if (progress.get_cancel() || device->have_error()) + return; + progress.set_status("Updating Images"); image_manager->device_update(device, this, progress); @@ -516,6 +526,9 @@ void Scene::update_kernel_features() else if (geom->is_hair()) { kernel_features |= KERNEL_FEATURE_HAIR; } + else if (geom->is_pointcloud()) { + kernel_features |= KERNEL_FEATURE_POINTCLOUD; + } } if (bake_manager->get_baking()) { @@ -568,6 +581,7 @@ static void log_kernel_features(const uint features) VLOG(2) << "Use Path Tracing " << string_from_bool(features & KERNEL_FEATURE_PATH_TRACING) << "\n"; VLOG(2) << "Use Hair " << string_from_bool(features & KERNEL_FEATURE_HAIR) << "\n"; + VLOG(2) << "Use Pointclouds " << string_from_bool(features & KERNEL_FEATURE_POINTCLOUD) << "\n"; VLOG(2) << "Use Object Motion " << string_from_bool(features & KERNEL_FEATURE_OBJECT_MOTION) << "\n"; VLOG(2) << "Use Camera Motion " << string_from_bool(features & KERNEL_FEATURE_CAMERA_MOTION) @@ -750,6 +764,15 @@ template<> Volume *Scene::create_node<Volume>() return node; } +template<> PointCloud *Scene::create_node<PointCloud>() +{ + PointCloud *node = new PointCloud(); + node->set_owner(this); + geometry.push_back(node); + geometry_manager->tag_update(this, GeometryManager::POINT_ADDED); + return node; +} + template<> Object *Scene::create_node<Object>() { Object *node = new Object(); @@ -837,6 +860,12 @@ template<> void Scene::delete_node_impl(Volume *node) geometry_manager->tag_update(this, GeometryManager::MESH_REMOVED); } +template<> void Scene::delete_node_impl(PointCloud *node) +{ + delete_node_from_array(geometry, static_cast<Geometry *>(node)); + geometry_manager->tag_update(this, GeometryManager::POINT_REMOVED); +} + template<> void Scene::delete_node_impl(Geometry *node) { uint flag; |