Open andreasplesch opened 8 months ago
The ktx2 basis formats are:
They need to a transcoded to GPU supported format:
s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),
etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),
etc2: !!gl.getExtension('WEBGL_compressed_texture_etc'),
pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc'),
astc: !!gl.getExtension('WEBGL_compressed_texture_astc'),
bptc: !!gl.getExtension('EXT_texture_compression_bptc')
https://caniuse.com/mdn-api_webgl_compressed_texture_s3tc https://caniuse.com/mdn-api_webgl_compressed_texture_etc1 https://caniuse.com/mdn-api_webgl_compressed_texture_etc https://caniuse.com/mdn-api_webgl_compressed_texture_pvrtc https://caniuse.com/mdn-api_webgl_compressed_texture_astc https://caniuse.com/?search=bptc
Filtering for IOS, Android and Firefox leaves only: astc !
Complex. Requires parsing of ktx2 files, and transcoding of 3 formats to GPU compressed formats depending on availability.
Collecting resources:
https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_basisu
https://github.com/BabylonJS/Babylon.js/pull/13284/files (for example) https://github.com/mrdoob/three.js/blob/b02c13bdeefddcf48cb9f012dd7695a24fc00ff1/examples/jsm/loaders/KTX2Loader.js https://github.com/mrdoob/three.js/pull/21984 https://github.com/mrdoob/three.js/pull/21984#issuecomment-867293728 https://github.com/donmccurdy/three.js/blob/dev/examples/jsm/libs/basis/basis_transcoder.wasm (480KB!) https://github.com/donmccurdy/KTX-Parse