Skip to content

Replace Draco GLB with a Compressed Meshes example - #10092

Merged
isumygin-sc merged 5 commits into
mainfrom
meshopt-glb-example
Nov 19, 2026
Merged

isumygin-sc merged 5 commits into
mainfrom
meshopt-glb-example

Conversation

@isumygin-sc

@isumygin-sc isumygin-sc commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

There was no example of loading a meshopt-compressed model since meshoptInitialize landed in #9738, and Draco had its own example. This replaces Loaders → Draco GLB with Loaders → Compressed Meshes, a single example for both:

image
  • The Stanford dragon three ways, side by side: uncompressed, compressed with EXT_meshopt_compression, and with KHR_draco_mesh_compression.
  • A label under each model shows its file size and the vertices and triangles it decoded to. The labels are screen-space elements placed with worldToScreen, as in User Interface → World to Screen.
  • It sets up both decoders: meshoptInitialize({ url }), which imports the decoder the first time a meshopt file loads, and the DracoDecoderModule wasm module.
  • Camera controls let you orbit and zoom to compare the three up close.
Size Vertices Triangles
Uncompressed 4.60 MB 100,207 201,031
Meshopt 0.75 MB 100,207 201,031
Draco 0.51 MB 104,399 201,031

Other changes:

  • loaders/draco-glb redirects to loaders/compressed-meshes in redirects.mjs.
  • heart_draco.glb and knight-meshopt.glb were only used by the removed examples, so they're deleted.

Model and license

The dragon is dragon_vrip_res2.ply from the Stanford 3D Scanning Repository, the repository's own ~200k-triangle decimation. Blender smoothed it, centered it, gave it a material, and wrote the uncompressed and Draco files from the same scene. The meshopt file is the uncompressed one run through gltfpack 1.2 -cc. stanford-dragon.txt records the source and every change, as the other models' notes do.

Stanford's terms allow free redistribution with credit, but not commercial use or use in a product for sale without their permission. They also ask that the dragon not be animated, morphed, or shown breaking. That's the same kind of restriction as the CC BY-NC models already in the examples. The example credits Stanford, and the dragons stay still while only the camera moves.

Testing

  • In the examples browser on WebGL 2 and WebGPU, switching devices both ways: all three load and label correctly, and the console is clean. Checked in desktop and portrait layouts.
  • The examples lint, typecheck:examples and check:thumbnails pass, and so does the production build. The old #/loaders/draco-glb link lands on the new example.
  • build:thumbnails couldn't launch its headless Chrome on my machine. I made the thumbnails the same way by hand: an 800×600 WebGL2 capture of the iframe page, resized to 320×240 and 64×48 WebP.

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

🤖 Generated with Claude Code

loaders/meshopt-glb loads the knight compressed with gltfpack -cc (EXT_meshopt_compression and
KHR_mesh_quantization) after meshoptInitialize points the engine at the decoder the examples already
ship, and plays both of its animations. knight-meshopt.glb is knight.glb with its geometry and
animation data compressed from 659 KB to about 100 KB; the textures are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Build size report

This PR does not change the size of the minified bundles.

Bundle Minified Gzip
playcanvas.min.js — —
playcanvas.min.mjs — —

Measured on a min build with identifier mangling off. In the shipped build esbuild renames identifiers by use count across the whole bundle, so any change reshuffles names file-wide and moves gzip/brotli by hundreds of bytes regardless of the actual change.

Shipped bundle sizes with this PR
Bundle Minified Gzip Brotli
playcanvas.min.js 2901.1 KB 754.6 KB 585.1 KB
playcanvas.min.mjs 2897.8 KB 753.7 KB 584.6 KB

@mvaligursky

Copy link
Copy Markdown
Contributor
  • pretty add a very brief description to example (see other examples)
  • what's the license for the model .. is this downloaded from somewhere (in which case add a licensing like other examples / assets do), otherwise if it's generated by you, please confirm.

@mvaligursky mvaligursky 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.

Automated review by OpenAI Codex (AI agent).

The loader implementation has no actionable runtime findings, and all reported CI checks pass. The model provenance/license concern is addressed by #9583, which states the knight was made for the example and ships under the repository license. I left one inline note about the missing example-browser description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isumygin-sc

Copy link
Copy Markdown
Contributor Author

@mvaligursky Added a description in ab076f6. The knight isn't downloaded: it's knight.glb from #9583, made for the examples and shipped under the repo's license, and knight-meshopt.glb is that file run through gltfpack.

loaders/compressed-meshes shows the Stanford dragon three ways, uncompressed, compressed with meshopt
and with Draco, each labeled with its file size, vertices and triangles. The dragon is Stanford's
dragon_vrip_res2.ply, smoothed and given a material in Blender, which also wrote the uncompressed and
Draco files; the meshopt file is the uncompressed one through gltfpack 1.2 -cc. loaders/draco-glb
redirects to the new example, and the heart and knight models the old examples used are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isumygin-sc isumygin-sc changed the title Add a meshopt-compressed GLB loader example Replace Draco GLB with a Compressed Meshes example Nov 19, 2026
@isumygin-sc

Copy link
Copy Markdown
Contributor Author

@mvaligursky Reworked after your approval, so worth another look: c3a7545 replaces Draco GLB with a single Compressed Meshes example (the Stanford dragon uncompressed, meshopt and Draco, each labeled with its size, vertices and triangles), and the dragon's Stanford terms are in the description and stanford-dragon.txt.

@mvaligursky

Copy link
Copy Markdown
Contributor

that description is too detailed. it’s an overview, not a documentation, otherwise good to merge, thanks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isumygin-sc

Copy link
Copy Markdown
Contributor Author

@mvaligursky Cut it down to one sentence in c5db242, thanks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isumygin-sc

Copy link
Copy Markdown
Contributor Author

@mvaligursky Dropped it in 4a965f5.

@isumygin-sc
isumygin-sc merged commit 3403a3e into main Nov 19, 2026
9 checks passed
@isumygin-sc
isumygin-sc deleted the meshopt-glb-example branch November 19, 2026 16:27
isumygin-sc added a commit that referenced this pull request Nov 19, 2026
* feat(examples): Add a meshopt-compressed GLB loader example

loaders/meshopt-glb loads the knight compressed with gltfpack -cc (EXT_meshopt_compression and
KHR_mesh_quantization) after meshoptInitialize points the engine at the decoder the examples already
ship, and plays both of its animations. knight-meshopt.glb is knight.glb with its geometry and
animation data compressed from 659 KB to about 100 KB; the textures are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add a description to the meshopt GLB example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(examples): Replace Draco GLB with a Compressed Meshes example

loaders/compressed-meshes shows the Stanford dragon three ways, uncompressed, compressed with meshopt
and with Draco, each labeled with its file size, vertices and triangles. The dragon is Stanford's
dragon_vrip_res2.ply, smoothed and given a material in Blender, which also wrote the uncompressed and
Draco files; the meshopt file is the uncompressed one through gltfpack 1.2 -cc. loaders/draco-glb
redirects to the new example, and the heart and knight models the old examples used are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Shorten the Compressed Meshes description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Drop the controls line from the Compressed Meshes description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

2 active deployments
Preview – engine — 4a965f59 Deployed Nov 19, 2026 by vercel[bot]
Preview – engine-api-docs — 4a965f59 Deployed Nov 19, 2026 by vercel[bot]
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.

2 participants