Hi guys,
first of all I would like to say big thank you to @donmccurdy for many usefull advices on this forum. I would like to ask, if you can tell me what am I doing wrong regards to KTX2 files generation. What I do is following:
- Download the following application Release v4.0.0 · KhronosGroup/KTX-Software · GitHub
- Based on the documentation Khronos Texture Tools: toktx I take my JPG file and generate KTX2 file: toktx --t2 Atlas1.ktx2 Atlas1.jpg
- Upload the file to CDN
- Prepare Three.js project with KTX2Loader (three.js docs) and Basis Universal GPU Texture Compression (https://appspowerplaymanager.vshcdn.net/images/winter-sports/minigame/basis) downloaded from three.js/examples/js/libs/basis at dev · mrdoob/three.js · GitHub
- When I tried to load the texture created by the described tool set I received:
Error: THREE.KTX2Loader: .transcodeImage failed.
at transcode (7ca89d84-a942-4a9a-bbc6-3923efc8d57e:107:23)
at 7ca89d84-a942-4a9a-bbc6-3923efc8d57e:46:103
I assumed that the problem is on my script but it was not true. I tested my script with textures found on Three.js Github and all 3 of them are working correctly:
- sample_etc1s.ktx2
- sample_uastc.ktx2
- sample_uastc_zstd.ktx2
All 3 of them are correctly loaded in my project. So I assume that the problem is not in JS/TS but in the KTX2 file that I generated. I also tried to compress the KTX2 file via ktxsc tool: ktxsc --encode etc1s --clevel 5 -qlevel 255 -o Atlas1.ktx2 Atlas1.ktx2
But without any possitive result. So I would like to ask if you can give me some advice what am I doing wrong. This is the list of all files:
- Original JPG file - https://appspowerplaymanager.vshcdn.net/images/winter-sports/minigame/downhill/textures/hill/Atlas1.jpg
- KTX2 generated via toktx command line - https://appspowerplaymanager.vshcdn.net/images/winter-sports/minigame/downhill/textures/hill/Atlas1.ktx2
- KTX2 files from Three.js examples:
https://appspowerplaymanager.vshcdn.net/images/winter-sports/minigame/downhill/textures/hill/Atlas2.ktx2
https://appspowerplaymanager.vshcdn.net/images/winter-sports/minigame/downhill/textures/hill/Atlas3.ktx2
https://appspowerplaymanager.vshcdn.net/images/winter-sports/minigame/downhill/textures/hill/Atlas4.ktx2
THANK YOU.