I have a mesh that I am trying to load which is using ktx2 compression and draco on my glb loader but I cannot get it to load, nor do I get an error message.
I have tested the asset in donmccurdy’s viewer and it seems to work there, while I dont see anything I am doing that is different (unless I am missing something). I had a working loader when using a regular draco compressed glb file, but switching to an embedded ktx2 texture breaks it entirely.
Nevermind, I had not properly set the KTX2Loader to be used with the gltf loader it seems.
The weird thing however, is that the glb loader does not throw an error, rather the error is coming from the onProgress callback. This might be a bug?
1 Like
I don’t think its a bug, because glb loader hands off the loading/parsing of the texture to the textureloader, and it sounds like the textureloader is reporting the error. Glad you got it working!
I think there was an intentional choice to let the model load even if some textures fail. But whether those texture errors should still be reported another way, I’m not sure…
As far I can see they are reported in the onProgress callback. Which feels a little backwards if there is an error callback right next to it. My thinking is that the meshloader internally has the textureloaders so it should report what its children are doing.
I think the idea is that onError
is only called if loading the model completely fails, so calling onLoad
and onError
are mutually exclusive. And we do want to continue loading the model despite missing a texture.
You might be able to get the more granular errors you’re looking for with LoadingManager – pass that into your loader constructors, then listen for all errors on the manager:
https://threejs.org/docs/index.html?q=loadingman#api/en/loaders/managers/LoadingManager
2 Likes