Glb with ktx2 compressed textures fail to load

Hi,

a glb with ktx2 compressed textures will fail to load in babylon versions > 5.43.2

khronosTextureContainer2.ts:417

   Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Worker': ArrayBuffer at index 0 is already detached.

#417 worker.postMessage({ action: "decode", data: dataCopy, caps: compressedTexturesCaps, options }, [dataCopy.buffer]);

affected versions: 5.44.0, 5.45.0

Sadly it is true…

Yes, sorry for the trouble, it has already been fixed and will be available in the next build:

3 Likes

Still problems with the yarn packages 5.45.0.
The code was not updated: https://yarnpkg.com/?q=babylonjs&p=1
https://cdn.jsdelivr.net/npm/babylonjs@5.45.0/babylon.max.js

                        if (KhronosTextureContainer2.DefaultDecoderOptions.isDirty) {
                            worker.postMessage({ action: "setDefaultDecoderOptions", options: KhronosTextureContainer2.DefaultDecoderOptions._getKTX2DecoderOptions() }, [
                                dataCopy.buffer,
                            ]);
                        }
                        worker.postMessage({ action: "decode", data: dataCopy, caps: compressedTexturesCaps, options: options }, [dataCopy.buffer]);
                    });

See Problems loading models after updating to version 5.45.0 - #4 by CristianLemeni, it will be fixed this week in 5.46.0.

@RaananW will deploy later today :slight_smile:

1 Like