Skip to content

glTF: warn in the console when a model uses Draco or meshopt mesh compression - #1896

Merged
obiot merged 1 commit into
masterfrom
claude/hopeful-hypatia-jl2ouu
Nov 18, 2026
Merged

obiot merged 1 commit into
masterfrom
claude/hopeful-hypatia-jl2ouu

Conversation

@obiot

@obiot obiot commented Nov 18, 2026

Copy link
Copy Markdown
Member

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 with glTF: 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:

  • The file requires the extension: it warns in the console, naming it, and the load fails with the same message:
    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 compression
  • The file only uses the extension (it also carries its meshes uncompressed): it warns and loads the uncompressed copy.

Decoding these through an optional plugin is ticketed in #1895.

Also:

  • The melonjs-3d-assets skill now covers both extensions in its loading section and in its "asset fails to load" troubleshooting row.
  • A line under Fixed in the changelog.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Checklist

  • I have read the Contributing Guide
  • My code follows the existing code style (pnpm lint passes)
  • I have tested my changes locally (pnpm test passes)
  • I have added tests that cover my changes (if applicable)
  • The build succeeds (pnpm build)

New tests in gltf.spec.js cover 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

…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
Copilot AI balanced review requested due to automatic review settings November 18, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@obiot
obiot merged commit 9a5b9e9 into master Nov 18, 2026
6 checks passed
@obiot
obiot deleted the claude/hopeful-hypatia-jl2ouu branch November 18, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants