summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-02-19 00:09:06 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-02-19 00:09:06 +0100
commit8cf1cfdc0fa13be6ae826883104c9fe605c0dfb1 (patch)
tree1bcdd9f860c34e4a86c8bcd42a8b23d6b5002822
parentf2dd03f1129ffb1dc155bab5ad466bddd7ba2039 (diff)
parent533eab89abfe27f775b76ed422d2cae7d5da600c (diff)
downloadredot-engine-8cf1cfdc0fa13be6ae826883104c9fe605c0dfb1.tar.gz
Merge pull request #88506 from puchik/multimesh-aabb-cull-fix
Fix reversed custom `AABB` check when recalculating multimesh `AABB`s
-rw-r--r--drivers/gles3/storage/mesh_storage.cpp4
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp
index 6c4bef10d5..8ab66e2bc6 100644
--- a/drivers/gles3/storage/mesh_storage.cpp
+++ b/drivers/gles3/storage/mesh_storage.cpp
@@ -1962,7 +1962,7 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
//if we have a mesh set, we need to re-generate the AABB from the new data
const float *data = p_buffer.ptr();
- if (multimesh->custom_aabb != AABB()) {
+ if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, multimesh->instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}
@@ -2113,7 +2113,7 @@ void MeshStorage::_update_dirty_multimeshes() {
if (multimesh->aabb_dirty && multimesh->mesh.is_valid()) {
multimesh->aabb_dirty = false;
- if (multimesh->custom_aabb != AABB()) {
+ if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, visible_instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index 21787b3fcf..1f362ffd21 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -1963,7 +1963,7 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
//if we have a mesh set, we need to re-generate the AABB from the new data
const float *data = p_buffer.ptr();
- if (multimesh->custom_aabb != AABB()) {
+ if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, multimesh->instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}
@@ -2087,7 +2087,7 @@ void MeshStorage::_update_dirty_multimeshes() {
if (multimesh->aabb_dirty) {
//aabb is dirty..
multimesh->aabb_dirty = false;
- if (multimesh->custom_aabb != AABB()) {
+ if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, visible_instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}