KTX2 Texture Not Loading in Expo + Three.js (React Native)

I’m trying to load KTX2 textures in a Three.js scene inside an Expo React Native app (using expo-gl and expo-three), and my GLTF model either doesn’t show up or renders without textures when I use KTX2. KTX2 assets are correctly downloaded and localUri is set. Textures in PNG format work as expected.

1 Like

My impression is that Expo’s support for image formats is limited:

… it presumably would need to implement explicit support for other texture formats. In the case of KTX2, the main thing is probably supporting THREE.CompressedTexture (including ETC2, ASTC, BCn, …), as that’s what KTX2 files in glTF/GLB models will be using to represent textures in three.js.

I couldn’t find an existing issue on the expo-three repository about this but I would suggest filing a feature request there.

1 Like

Thank you for the suggestion! Filing a feature request on the expo-three repository sounds like the right next step to get official support for KTX2 textures. Meanwhile, as a workaround, I have been manually integrating the KTX2Loader from three.js with the GLTFLoader and setting the transcoder path, but full seamless support within Expo is still missing. If others have found or developed any working Expo-compatible KTX2 loading patterns, sharing those would help as well. I’ll create the request and contribute details about the current limitations and possible integration approaches.

One other idea, perhaps helpful for you or for the Expo developers — there are a collection of KTX2 textures in the three.js ktx2 loader example. glTF files always use “Universal” formats shown in this example, ETC1S and UASTC, but support for these might be more difficult in Expo due to the need for GPU texture formats, Web Workers, and WASM. An implementation in Expo could start with just the “Uncompressed” or “Compressed” KTX2 formats as a first step toward supporting the “Universal” formats.