meshoptimizer
meshoptimizer copied to clipboard
gltfpack: EXT_texture_webp support
Spec here.
Model before: webp_demo.zip
{
"textures":[{"sampler":0,"extensions":{"EXT_texture_webp":{"source":0}}}],
"extensionsUsed":["EXT_texture_webp"],"extensionsRequired":["EXT_texture_webp"]
}
Model after: webp_demo_gltfpack.zip
{
"extensionsUsed":["KHR_mesh_quantization","KHR_texture_transform"],"extensionsRequired":["KHR_mesh_quantization"],
"textures":[{}]
}
A similar thing is the proposal of EXT_texture_avif. Or maybe gltfpack can just keep all unknown extensions of texture for maximum compatibility.
This requires https://github.com/jkuhlmann/cgltf/issues/248; I'm not very interested in implementing this myself and gltfpack can't encode webp images without external dependencies anyway so the best it can do here is to preserve inputs as is, but if the linked issue gets implemented I can take a look at this.
Keeping unknown extensions doesn't work because image files need to be parsed for material transparency optimization.