Hi Everyone,
I am new to three.js and I am currently trying to load gltf files with .basis extension. I see that the gltf loader has a basisu extension but we are not using ktx2 files. Rather, I am trying to use the loader manager + Basis texture loader from the examples folder. However, when loading, my object seems to be metallic and the normal map is unable to load and we are seeing errors such as:
WARNING: texture bound to texture unit 3 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?
Here you can find the code im using to load it: three.js/webgl_loader_gltf.html at 7e6d92e0be78128a91a89761f563e34554ecf9ec · siegalej/three.js · GitHub
And the assets themselves are here:
three.js/examples/models/gltf/AntiqueCameraAsset/compressed at dev · siegalej/three.js · GitHub</tit
Any help would be appreciated! Thanks!
What are the dimensions (width & height) of your basis textures?
Note that the glTF format does not technically allow .basis
files, .ktx2
files are completely equivalent compression and have tooling provided to address things like texture size limitations of WebGL 1.
If you do want to patch .basis
support into GLTFLoader, I would start by ensuring that (1) all textures are power-of-two dimensions (e.g. 1024x1024) and (2) have full mip map chain embedded in the file. You can relax those restrictions later but it will make debugging much harder at first.
Hi, our ImageBitMap is 2048 x 2048
Note that the glTF format does not technically allow
.basis
files,.ktx2
files are completely equivalent compression and have tooling provided to address things like texture size limitations of WebGL 1
Right, I see that there is an extension created for .ktx2 files that use basis compression. However, we prefer to go the .basis route because of the significantly smaller file sizes. One thread I saw that I see you were active in was this one: Compressed Texture Workflow (glTF|Basis) - #9 by weiserhei
Is this type of solution still viable? This is what I was following
There is no difference in size if your compression settings are the same — .ktx2
files are just slightly different wrappers around exactly the same Basis Universal compression format, I’d expect them to be identical to “within a few bytes”.
The .basis
workaround was always a hack and you’ll have to know much more about how texture sizes and mipmap settings affect different WebGL APIs, for no benefit, I don’t really recommend it. Plus there are viewers that can check your .ktx2
images on their own, which don’t exist for the .basis
format.