Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicated vertices after 3D NavigationMesh bake #92181

Merged
merged 1 commit into from
May 21, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented May 21, 2024

Removes duplicated vertices that may exist on shared polygon corners after a ReCast navigation mesh bake.

What this does reduce is processing and NavigationMesh resource memory footprint. This does not really change anything qualitywise for the pathfinding. The NavigationServer converted a NavigationMesh resource by polygon indices to a server native mesh anyway.

While working on editor tooling for navigation mesh I noticed that I got way more vertices handles than expected. This only happened with a ReCast baked navigation mesh in 3D but not with the 2D navigation mesh baking.

Turns out because ReCast has the vertices and indices per local polygon "group" and Godot combines all the local groups to just one navigation mesh that there are often a lot of duplicated vertices everytime polygon groups shared a vertex.

On a demo that has a lot of very large navigation mesh chunks this change nearly halved the total vertices count of the used NavigationMesh resources.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature enhancement sounds great. Not done any technical testing.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 May 21, 2024
Removes duplicated vertices that may exist on shared polygon corners after a ReCast navigation mesh bake.
@akien-mga akien-mga merged commit d916423 into godotengine:master May 21, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@smix8 smix8 deleted the recast_vertices_dup branch May 21, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants