I recently started using the glTF Tools VScode extension and I’ve run into some problems with EXT_meshopt_compression. It is listed under supported extension schemas of the glTF Validator, but i keep getting warnings saying that It’s not supported. Also if I try to convert any glTF file which uses EXT_meshopt_compression to glb (using the VSCode extension), the resulting files seem to be corrupted.
Any ideas, what might be causing this?
I think the VSCode extension’s support here is limited to just certain basic understanding of the JSON schema. It probably cannot repackage the compressed file into GLB, and also glTF Validator cannot do a deeper validation of the compressed vertex data. See the glTF Validator extension list.
Compression (with Draco or Meshopt) should probably done only as the very last step of an asset pipeline. Very few, if any, tools can edit the compressed vertex stream without decompressing and recompressing it, which may create some additional loss of precision.
If you simply need to convert a compressed
.glb you could use glTF Transform’s CLI or https://gltf.report/ , but this does involve decompressing and recompressing the file’s vertex data, so there may be some small loss of precision.
Okay, yes it makes sense to do the compression only at the very end. I was thinking that since I’m not really editing the textures and vertex data that it shouldn’t be a problem, but also there’s no reason to first compress and then further edit the gltf.
Yeah, it certainly is possible to convert
.glb without the decompress/compress step, if you had to… But I think most tools are built around the assumption that you’ll be doing more complex edits than just that, and so they unpack the model unconditionally.