We’re using the GLTFExporter to export models to GLB and one of the things we noticed is that even if the textures are loaded as jpegs, the exporter is hardcoded to convert them to PNGs, which can really bloat the output size.
It seems like with a couple small changes to the GLTF Exporter, we can make the texture mime-type an option that could be passed into GLBAsync() like so:
That was my assumption as well, but in our use-case we don’t need alpha channels at all and could really do with the size reduction. Would be great if that was a decision up to the caller. I’ve tested the code changes in those two places and it works great.
We’ve talked about this in the past. Like @sebavan says, we just need to be careful about the alpha channel since JPG has no alpha channel. I expect if we add a setting to export JPG, it will only do it if the texture has no alpha channel. We will be happy to accept contributions in this area.