Loading .glb file with .dds texture

Hello everyone…
Recently I decided to change texture format from .png to .dds of my models. I converted it and then converted it all (mtl, obj, dds) to .glb. I thought that scene gonna work smoother and whole application will consume less memory. But I came across this error which I’m not sure what means:

ERROR Error: Uncaught (in promise): Error: /textures/0: Error while trying to load image: 68,68,83,32,124,0,0,0,7,16,10,0,... - Fallback texture was used
Error: /textures/0: Error while trying to load image: 68,68,83,32,124,0,0,0,7,16,10,0,... - Fallback texture was used
    at babylonjs.loaders.min.js:1
    at M (babylon.js:16)
    at Image.d (babylon.js:16)
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:41344)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:465)
    at invokeTask (zone-evergreen.js:1603)
    at Image.globalZoneAwareCallback (zone-evergreen.js:1629)
    at resolvePromise (zone-evergreen.js:797)
    at resolvePromise (zone-evergreen.js:754)
    at zone-evergreen.js:858
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:41344)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at drainMicroTaskQueue (zone-evergreen.js:559)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:469)
    at invokeTask (zone-evergreen.js:1603)

Does anyone know what could it mean? Babylon can’t load glb with dds texture?

Edit*
Also, when I want to load dds texture from my local server i got this warning:
babylon.js:16 BJS - [13:38:42]: Failed to load http://localhost:5000/file_name-dxt.ktx, falling back to http://localhost:5000/file_name.dds
I’m wondering why it’s loading dxt at first? And also, still can’t load .dds texture

Pinging @bghgary and @Evgeni_Popov but I don’t think gltf supports dds (At least in the spec)

There seems to be a vendor extension for DDS textures, although I have not used it.

Loading DDS generically is prohibitively difficult on the web. Babylon.js only supports a small subset of DDS files. glTF supports DDS through a Microsoft extension (as @cx20 mentions), but it is not going to work everywhere. It’s also a bit underspecified in terms of what kinds of DDS it allows.

If you are looking for compressed textures, you can use KTX via the KHR_texture_basisu extension for glTF. Some docs for Babylon.js here: KTX2 Compressed Textures | Babylon.js Documentation

Thank you everyone for your reply, I was able to successfully load gltf with dds texture, It wasn’t working with glb, but gltf handled it pretty well! With png texture I could load like 20% of the model and still was lagging, now, with dds I can load the full model and it works perfectly! I’ll be testing it for the next few weeks so when I came into some bugs, I’ll check ktx, thanks again!

1 Like

I would not recommend going this if you are directly using glTF without a DDS extension, even if it works. glTF is not intended to support DDS without extensions. We may change the code to block this from working in the future as it is not per spec.

That’s odd. There shouldn’t be a difference between gltf and glb.

1 Like