BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.7k stars 263 forks source link

shrinking wasm for glTF extension support #359

Open andreasplesch opened 1 year ago

andreasplesch commented 1 year ago

We are exploring supporting the glTF_texture_basisu extensions without requiring heavy wasm files.

The extension requires support for these internal formats:

Since ASTC seems to be the most widely (chrome/firefox/safari/android/ios) GPU compressed format, we would only target ASTC, and require fallback textures if not available.

https://github.com/BinomialLLC/basis_universal/wiki/How-to-Use-and-Configure-the-Transcoder#shrinking-the-transcoders-compiled-size

provides options to select for compilation: BASISD_SUPPORT_UASTC BASISD_SUPPORT_ASTC or BASISD_SUPPORT_ASTC_HIGHER_OPAQUE_QUALITY plus BASISD_SUPPORT_KTX2_ZSTD to 1

would then suffice ?

Would else would need to be considered ?

andreasplesch commented 1 year ago

With these options, eg. only ASTC support the wasm shrinks to 260KB which is bit better. With BASISD_SUPPORT_ASTC_HIGHER_OPAQUE_QUALITY it goes up to 330KB. Let's see if this is useful.