Repository navigation
glTF: warn in the console when a model uses Draco or meshopt mesh compression - #1896
Merged
Merged
Conversation
…pression The loader cannot decode KHR_draco_mesh_compression, EXT_meshopt_compression or KHR_meshopt_compression. A file that requires one now warns, naming the extension, and fails with the same message, instead of an accessor error that never mentioned it. A file that only uses one (with an uncompressed copy of its meshes) warns and loads that copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JnzwA4a7ZyjLBpbeEpFLu6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The glTF loader can't decode Draco (
KHR_draco_mesh_compression) or meshopt (EXT_meshopt_compression,KHR_meshopt_compression). Before this change, a Draco model failed withglTF: accessor N has no bufferView (sparse / zero-initialized accessors are not supported), which never mentions Draco.The loader now checks the file's extension lists before reading any geometry:
melonJS: this glTF model (models/fox.glb) uses Draco mesh compression (KHR_draco_mesh_compression), which the loader cannot decode: export it again without mesh compressionDecoding these through an optional plugin is ticketed in #1895.
Also:
melonjs-3d-assetsskill now covers both extensions in its loading section and in its "asset fails to load" troubleshooting row.Type of change
Checklist
pnpm lintpasses)pnpm testpasses)pnpm build)New tests in
gltf.spec.jscover each of the three extensions, both required and only used, plus a model using a supported extension that must not warn. The glTF test file passes (119 tests). I didn't rerun the full engine suite for this change; CI runs it.Related issues
Related to #1895
Generated by Claude Code