GLTFLoader with basisLoader renders only alpha map on iOS

Hello everyone

I’m loading a compressed .glb scene with .basis textures (via gltfpack) to my website and I’ve run onto the next problem:

All my textures have been resized to square power of 2 sizes (in order to make them work on IOS).

On different scenes where there are approx. 10 textures everything works perfectly, but I have a scene with +20 textures and when I load them on an iPhone there is always the same textures that renders only the alpha map of the image (its a png image converted to .basis).

It is supposed to look like the following image (on pc both edge and chrome, mac both safari and chrome, and android works): https://ibb.co/LSjYkX4

but on ios (iPhone and iPad) it looks like this: https://ibb.co/vh8fGRx

I’ve come to the conclusion that this may have to do with the number of textures because if I delete all textures and leave only the ones that render the alpha map, then they look OK.

Also, if I turn the image to jpg with no alpha, then the textures renders ok. It only happens with png images.

I was wondering if anyone has experienced this and has a workaround, since everything I have tried has failed.

Please note that GLTFLoader, and the glTF format, do not yet support Basis. If you’re using custom code to load models this way, you’ll need to share enough code (and a demo, ideally) so that we can fully reproduce the issue.

Additionally, alpha channels in Basis compressed textures are more complicated than in PNG… it’s entirely possible you’ll need changes to BasisTextureLoader to get all of this working, or to wait until future changes like https://github.com/mrdoob/three.js/pull/18490 have landed.

Hello! Thank you for your response.
I am indeed using a custom loader, this one: https://github.com/zeux/meshoptimizer/blob/0800af19c23f818f93c3a29bfeec17b076863d85/demo/GLTFLoader.js
It basically checks if the texture is .basis extension and loads it with the threejs BasisLoader.
I’ve uploaded a demo here:
http://basistest.hyperstudio.es/
On iOS the transcoding speed is not ideal, it actually takes longer than loading the not optimized moder that is 12mb, so I’m not really sure if I’ll end up using the original model, but still I wanted to give it a try since the compression ratio with basis is impressive and it seems render speed is also improved.
I’ve been reading also about the ktx2 loader, but it seemed to me although basis was not going to be the definitive extension for gpu supercompressed textures there was more documentation about it than ktx2.
Thank you again for your time!