summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:21:01 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:21:01 +0100
commit13593d8644286278004242dd6c2bd27a15ab9162 (patch)
treec9b0c163407f992785e349641e4b773a4f9d40d7 /servers/rendering
parent791e742af7337bfe3107552612d19b6d53b3d8fc (diff)
parentb7088bbf5276a9d991724f697df970ec30a57c2f (diff)
Merge pull request #70087 from clayjohn/mesh-aabb
Cache mesh AABB when modified by skeleton and update instance AABB when skeleton changes
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp2
-rw-r--r--servers/rendering/renderer_scene_cull.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index 503a25184e..1487336d8d 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -715,6 +715,8 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
}
}
+ mesh->aabb = aabb;
+
mesh->skeleton_aabb_version = skeleton->version;
return aabb;
}
diff --git a/servers/rendering/renderer_scene_cull.h b/servers/rendering/renderer_scene_cull.h
index 2030af204d..51f800381b 100644
--- a/servers/rendering/renderer_scene_cull.h
+++ b/servers/rendering/renderer_scene_cull.h
@@ -476,6 +476,7 @@ public:
Instance *instance = (Instance *)tracker->userdata;
switch (p_notification) {
case Dependency::DEPENDENCY_CHANGED_SKELETON_DATA:
+ case Dependency::DEPENDENCY_CHANGED_SKELETON_BONES:
case Dependency::DEPENDENCY_CHANGED_AABB: {
singleton->_instance_queue_update(instance, true, false);
@@ -491,8 +492,7 @@ public:
case Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE: {
singleton->_instance_queue_update(instance, true, true);
} break;
- case Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES:
- case Dependency::DEPENDENCY_CHANGED_SKELETON_BONES: {
+ case Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: {
//ignored
} break;
case Dependency::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR: {