Repository navigation
Replace Draco GLB with a Compressed Meshes example - #10092
Conversation
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>
Build size reportThis PR does not change the size of the minified bundles.
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
|
|
mvaligursky
left a comment
There was a problem hiding this comment.
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>
|
@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>
|
@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. |
|
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>
|
@mvaligursky Cut it down to one sentence in c5db242, thanks. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@mvaligursky Dropped it in 4a965f5. |
* 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>
Description
There was no example of loading a meshopt-compressed model since
meshoptInitializelanded in #9738, and Draco had its own example. This replaces Loaders → Draco GLB with Loaders → Compressed Meshes, a single example for both:EXT_meshopt_compression, and withKHR_draco_mesh_compression.worldToScreen, as in User Interface → World to Screen.meshoptInitialize({ url }), which imports the decoder the first time a meshopt file loads, and theDracoDecoderModulewasm module.Other changes:
loaders/draco-glbredirects toloaders/compressed-meshesinredirects.mjs.heart_draco.glbandknight-meshopt.glbwere only used by the removed examples, so they're deleted.Model and license
The dragon is
dragon_vrip_res2.plyfrom 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 throughgltfpack 1.2 -cc.stanford-dragon.txtrecords 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
lint,typecheck:examplesandcheck:thumbnailspass, and so does the productionbuild. The old#/loaders/draco-glblink lands on the new example.build:thumbnailscouldn'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
🤖 Generated with Claude Code