summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-08 23:23:50 +0100
committerGitHub <noreply@github.com>2022-02-08 23:23:50 +0100
commit25d4c14fef0b76b8f4dcc09214b5b30f84998e62 (patch)
tree8b6f4000dbd9b7e053ac21f8f9a366304d2db862 /modules
parent8907c566ed24b5c648c5b733b85e004299a51c27 (diff)
parentdd970482c5961278034fde5fb2961e31c543e9ae (diff)
Merge pull request #57627 from JFonS/occluder_improvements
Diffstat (limited to 'modules')
-rw-r--r--modules/meshoptimizer/register_types.cpp6
-rw-r--r--modules/raycast/raycast_occlusion_cull.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/modules/meshoptimizer/register_types.cpp b/modules/meshoptimizer/register_types.cpp
index 57a1b697be..597c12ed23 100644
--- a/modules/meshoptimizer/register_types.cpp
+++ b/modules/meshoptimizer/register_types.cpp
@@ -38,6 +38,9 @@ void register_meshoptimizer_types() {
SurfaceTool::simplify_with_attrib_func = meshopt_simplifyWithAttributes;
SurfaceTool::simplify_scale_func = meshopt_simplifyScale;
SurfaceTool::simplify_sloppy_func = meshopt_simplifySloppy;
+ SurfaceTool::generate_remap_func = meshopt_generateVertexRemap;
+ SurfaceTool::remap_vertex_func = meshopt_remapVertexBuffer;
+ SurfaceTool::remap_index_func = meshopt_remapIndexBuffer;
}
void unregister_meshoptimizer_types() {
@@ -45,4 +48,7 @@ void unregister_meshoptimizer_types() {
SurfaceTool::simplify_func = nullptr;
SurfaceTool::simplify_scale_func = nullptr;
SurfaceTool::simplify_sloppy_func = nullptr;
+ SurfaceTool::generate_remap_func = nullptr;
+ SurfaceTool::remap_vertex_func = nullptr;
+ SurfaceTool::remap_index_func = nullptr;
}
diff --git a/modules/raycast/raycast_occlusion_cull.cpp b/modules/raycast/raycast_occlusion_cull.cpp
index dd5eef8b2b..2e0d17fb28 100644
--- a/modules/raycast/raycast_occlusion_cull.cpp
+++ b/modules/raycast/raycast_occlusion_cull.cpp
@@ -270,13 +270,14 @@ void RaycastOcclusionCull::scenario_set_instance(RID p_scenario, RID p_instance,
OccluderInstance &instance = scenario.instances[p_instance];
+ bool changed = false;
+
if (instance.removed) {
instance.removed = false;
scenario.removed_instances.erase(p_instance);
+ changed = true; // It was removed and re-added, we might have missed some changes
}
- bool changed = false;
-
if (instance.occluder != p_occluder) {
Occluder *old_occluder = occluder_owner.get_or_null(instance.occluder);
if (old_occluder) {