Hello community !
CONTEXT
I’m currently using gltf-transform to transform my textures to KTX / using etc1s conversion using on my glb :
gltf-transform etc1s output1.glb output2.glb --quality 255 --verbose
The KTX2Loader return as compressed format supports :
astc / etc2 / pvrtc
So naturally the basis module transcode the textures to any supported format. it works.
PROBLEM
There is a particular phone I had feedbacks on, Iphone 13 pro max, which get supports from ASTC and ETC1
But, We can also see that etc1 support is set to false when using webGL2, even if the format is supported for some design reasons.
In this setup the file converted using ETC1 does not run and uses fallback :
‘THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32.’
Im reading on the discussion here : WebGLTextures: Use `gl.texStorage2D()` with compressed textures. by Mugen87 · Pull Request #22928 · mrdoob/three.js · GitHub that etc1 on webgl2 cannot work by design.
QUESTIONS
There are a lot questionnement :
1 ) Is there a universal KTX compression format that would transcode to any format the system support ? ASTC produces way higher texture sizes and gets really heavy and not suitable for the application I’m working on. Like 1 file for all other than ASTC ?
Am I stuck with producing an ASTC file for the Iphone 13 pro max particular setup ?
2 ) On a second point, I’ll need some memory back, unless I forgot everything, and being completely wrong, I think I remember using .basis format file just standalone back in days ( like years ago ), using a basistextureloader that could handle the conversion from a basis file to any supported format, even ASTC ? ( unless I’m completely wrong of course )
3 ) “when using gl.texStorage2D() ETC1 is not supported”, is the issue that cuts down the support for ETC1 in webGL2.
Is there a way around this ?
I’m really not aware of the usage of texImage2D vs texStorage2D, and not aware at all of the current design of threejs around this, can someone explain ?
Thank you a lot