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

Only store vertices referenced by the indices per surface in the glTF importer #89418

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

lyuma
Copy link
Contributor

@lyuma lyuma commented Mar 12, 2024

Fixes an error present in many vrm gltf documents (such as exported VRM). In these cases, surfaces (aka gltf primitives) on a given mesh share their vertex buffer in the gltf document.

One example vrm file has 11 surfaces on a single mesh, all sharing the vertex buffer.
Before this change, the imported mesh data alone takes 318MB. After this change, the same mesh data is now down to 49MB

Fixes #80195

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Mar 12, 2024
modules/gltf/gltf_document.h Outdated Show resolved Hide resolved
modules/gltf/gltf_document.cpp Outdated Show resolved Hide resolved
@lyuma lyuma force-pushed the gltf_vertex_packing branch from ed7b3ab to 4ccd6a7 Compare March 14, 2024 01:14
@lyuma lyuma force-pushed the gltf_vertex_packing branch from 4ccd6a7 to 77f6e35 Compare March 14, 2024 01:35
@AThousandShips AThousandShips changed the title glTF importer now only stores vertices referenced by the indices per surface Only store vertices referenced by the indices per surface in the glTF importer Mar 14, 2024
@akien-mga akien-mga merged commit 21b33c5 into godotengine:master Mar 14, 2024
16 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.

gltf: Extreme memory bloat importing files with shared vertex buffers.
4 participants