Loading compressed textures from object url

I’m not sure if it is really a bug or an intended way. But I’m not able to load compressed textures with an object url. The reason for that is probably because the file extension is missing.

In our use case it is for example a -dxt.ktx file, that we preload as a blob and then create an object url. Reason for that is simply, that we have to do some precalculation with the blob.

I’ve noticed in the API that Engine.createTexture has an optional Parameter forcedExtension. However, the constructor for a Texture does not provide this parameter and always passes ‘null’ to the engine function.
In this Thread I’ve seen that there is already a solution for CubeTextures https://forum.babylonjs.com/t/urls-that-lack-extensions/11757

Playground (with an -dxt.ktx file as example):

Do you want to create a PR for it ?

sure, I’ll look into it tomorrow

1 Like