Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/object.cpp
| Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | void Object::tag_update(Scene *scene) | ||||
| uint32_t flag = ObjectManager::UPDATE_NONE; | uint32_t flag = ObjectManager::UPDATE_NONE; | ||||
| if (is_modified()) { | if (is_modified()) { | ||||
| flag |= ObjectManager::OBJECT_MODIFIED; | flag |= ObjectManager::OBJECT_MODIFIED; | ||||
| if (use_holdout_is_modified()) { | if (use_holdout_is_modified()) { | ||||
| flag |= ObjectManager::HOLDOUT_MODIFIED; | flag |= ObjectManager::HOLDOUT_MODIFIED; | ||||
| } | } | ||||
| if (is_shadow_catcher_is_modified()) { | |||||
| scene->tag_shadow_catcher_modified(); | |||||
| } | |||||
| } | } | ||||
| if (geometry) { | if (geometry) { | ||||
| if (tfm_is_modified()) { | if (tfm_is_modified()) { | ||||
| flag |= ObjectManager::TRANSFORM_MODIFIED; | flag |= ObjectManager::TRANSFORM_MODIFIED; | ||||
| } | } | ||||
| if (visibility_is_modified()) { | if (visibility_is_modified()) { | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (!bounds.valid() || bounds.size() == zero_float3()) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* TODO(sergey): Check for mesh vertices/curves. visibility flags. */ | /* TODO(sergey): Check for mesh vertices/curves. visibility flags. */ | ||||
| return true; | return true; | ||||
| } | } | ||||
| uint Object::visibility_for_tracing() const | uint Object::visibility_for_tracing() const | ||||
| { | { | ||||
| uint trace_visibility = visibility; | return SHADOW_CATCHER_OBJECT_VISIBILITY(is_shadow_catcher, visibility & PATH_RAY_ALL_VISIBILITY); | ||||
| if (is_shadow_catcher) { | |||||
| trace_visibility &= ~PATH_RAY_SHADOW_NON_CATCHER; | |||||
| } | |||||
| else { | |||||
| trace_visibility &= ~PATH_RAY_SHADOW_CATCHER; | |||||
| } | |||||
| return trace_visibility; | |||||
| } | } | ||||
| float Object::compute_volume_step_size() const | float Object::compute_volume_step_size() const | ||||
| { | { | ||||
| if (geometry->geometry_type != Geometry::MESH && geometry->geometry_type != Geometry::VOLUME) { | if (geometry->geometry_type != Geometry::MESH && geometry->geometry_type != Geometry::VOLUME) { | ||||
| return FLT_MAX; | return FLT_MAX; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | if (scene->objects.size() == 0) | ||||
| device_update_transforms(dscene, scene, progress); | device_update_transforms(dscene, scene, progress); | ||||
| } | } | ||||
| if (progress.get_cancel()) | if (progress.get_cancel()) | ||||
| return; | return; | ||||
| /* prepare for static BVH building */ | /* prepare for static BVH building */ | ||||
| /* todo: do before to support getting object level coords? */ | /* todo: do before to support getting object level coords? */ | ||||
| if (scene->params.bvh_type == SceneParams::BVH_STATIC) { | if (scene->params.bvh_type == BVH_TYPE_STATIC) { | ||||
| scoped_callback_timer timer([scene](double time) { | scoped_callback_timer timer([scene](double time) { | ||||
| if (scene->update_stats) { | if (scene->update_stats) { | ||||
| scene->update_stats->object.times.add_entry( | scene->update_stats->object.times.add_entry( | ||||
| {"device_update (apply static transforms)", time}); | {"device_update (apply static transforms)", time}); | ||||
| } | } | ||||
| }); | }); | ||||
| progress.set_status("Updating Objects", "Applying Static Transformations"); | progress.set_status("Updating Objects", "Applying Static Transformations"); | ||||
| ▲ Show 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | if ((flag & GEOMETRY_MANAGER) == 0) { | ||||
| if ((flag & VISIBILITY_MODIFIED) != 0) { | if ((flag & VISIBILITY_MODIFIED) != 0) { | ||||
| geometry_flag |= GeometryManager::VISIBILITY_MODIFIED; | geometry_flag |= GeometryManager::VISIBILITY_MODIFIED; | ||||
| } | } | ||||
| scene->geometry_manager->tag_update(scene, geometry_flag); | scene->geometry_manager->tag_update(scene, geometry_flag); | ||||
| } | } | ||||
| scene->light_manager->tag_update(scene, LightManager::OBJECT_MANAGER); | scene->light_manager->tag_update(scene, LightManager::OBJECT_MANAGER); | ||||
| /* Integrator's shadow catcher settings depends on object visibility settings. */ | |||||
| if (flag & (OBJECT_ADDED | OBJECT_REMOVED | OBJECT_MODIFIED)) { | |||||
| scene->integrator->tag_update(scene, Integrator::OBJECT_MANAGER); | |||||
| } | |||||
| } | } | ||||
| bool ObjectManager::need_update() const | bool ObjectManager::need_update() const | ||||
| { | { | ||||
| return update_flags != UPDATE_NONE; | return update_flags != UPDATE_NONE; | ||||
| } | } | ||||
| string ObjectManager::get_cryptomatte_objects(Scene *scene) | string ObjectManager::get_cryptomatte_objects(Scene *scene) | ||||
| Show All 33 Lines | |||||