Ktx2 image support within Babylon.JS GUI

Hi,
recently I tried to use a .ktx2 image within the Babylon.JS Gui, but I couldn’t get it to work. There were no errors reported in the console and no exceptions thrown from Babylon.

I ended up recreating the issue in the playground here: https://playground.babylonjs.com/#G5H9IN#135
Note there is only one image shown, and that image is a png. The ktx2 image is not shown.

Does the GUI support .ktx2 textures?

Thanks.

cc @carolhmj, but I think the GUI image is using the browser Image object, so .ktx2 would not work.

2 Likes

The GUI uses an HTML image DOM element to load the image, so if the browser doesn’t support .ktx2 files, then it won’t load in the Babylon GUI.

I’m not seeing a way to easily generate an error if the image doesn’t load, yet. I’m not getting an error from Edge or Chrome when setting src with a .ktx2 extension. I don’t think we can know the image didn’t load.

2 Likes

Yep it doesn’t seem that HTML supports loading KTX yet, I’ve found a small discussion about it: Support KTX2 Texture Compression Format (google.com) but nothing concrete. :pensive:

1 Like

Thanks to everyone for the information. :+1: