GLTF and / or GLB online optimization and compression

This is intended for all who would be looking for a quick way of optimizing and compressing their GLTF / GLB models online.

Just use my GM Viewer which includes the following PRESET export options from glTF Transform:

  • DRACO (marked as GLB_d)
  • MESHOPT (marked as GLB_m)

The viewer will allow you to select the maximum exported texture resolution and a choice of 5 texture formats:

  • None (original texture format)
  • WEBP (from glTF Transform)
  • and from experimental ktx2-encoder:
    • KTX2 for ETC1S + UASTC compression
    • KTX2e for ETC1S Only compression
    • KTX2u for UASTC Only compression

You could export your model by using all available options and then, size / quality wise, compare their outputs to see if any of them might work for your purposes.

Any other options that you might require would involve using the command line in terminal, as you might find as a suggestion in some other topics.

This viewer can be used as a standalone so modify and improve whatever you can.

Viewing the exported models in any GLTF Viewer would require that it has DRACO and / or MESHOPT decoders already included plus any texture extension that might be required.

3 Likes

Nice one i using to compress my GLBs

That’s awesome!! Might I request drag and drop? And also maybe a link to the boilerplate for setting up the loaders with meshopt+ktx2 etc? :smiley: Then I can direct people to one stop for optimizing and how to load the optimized meshes.
Cool stuff!

Good stuff. I’ll be sticking with gltf.report for now though, as it’s more mature.
Kudos on having the WebP option, I think gltf.report might be able to do it but I’d have to check the gltf transform docs for that.

What I’d really love is for options to convert textures to KTX2 formats, so that 3D modellers can send me a fully optimised model when working on a project.

1 Like

@manthrax and @Arthur,

KTX compression appears to only be available in command line interface, so there is no way for me to include it as a web option.

I have not included either drag-and-drop or ZIP support in any of my viewers and not really looking to do so.

This is not to stop anyone from trying to improve it on their own since this viewer’s HTML file can be used as a standalone. If somebody does come up with a code that can be weaved into the existing code then I could include it as well.

@manthrax and @Arthur and all other forum users,

There is now KTX2 support included with a choice of either ETC1S or UASTC. Even though it appears to work properly it should be considered as experimental.

A recently posted ktx2-encoder on NPM is providing this KTX2 support and appears to be doing it properly. Do note that this process can be a little bit slow so just be patient.

My GM Viewer’s menu controls were adjusted and my initial post was updated to reflect this new change.

2 Likes