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

Fix a crash in ImporterMesh::create_shadow_mesh for non-triangle surfaces #96880

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

zeux
Copy link
Contributor

@zeux zeux commented Sep 11, 2024

optimize_vertex_cache_func assumes the input is a triangle mesh; when an imported mesh contains points/lines/triangle strips, this code should be disabled.

Introduced in #94241
Fixes #96869

…aces

optimize_vertex_cache_func assumes the input is a triangle mesh; when an
imported mesh contains points/lines/triangle strips, this code should be
disabled.
@zeux
Copy link
Contributor Author

zeux commented Sep 11, 2024

Aside: in the linked issue report, the primitives in question are lines; creating shadow meshes for point/line primitives seems dubious. However, it's still valuable for triangle strips in case they get through here through the importer flow, so this check is probably still a good idea even if we end up adding some early outs for lines/points in the future.

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Makes sense! Indeed creating a shadow mesh should be skipped anyway for points and line primitives, I can't see how it would be beneficial

@clayjohn clayjohn added this to the 4.4 milestone Sep 11, 2024
@akien-mga akien-mga changed the title Fix a crash in ImporterMesh::create_shadow_mesh for non-triangle surfaces Fix a crash in ImporterMesh::create_shadow_mesh for non-triangle surfaces Sep 12, 2024
@akien-mga akien-mga merged commit b214aa8 into godotengine:master Sep 12, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

crash opening glb file
3 participants