Hi
I’m using the CubeTexture function (in combination with a promise) and it seems that the onError callback is not called if you try to load the same (broken) texture again.
Not sure if this is a bug of if I’m doing something wrong.
const url = 'broken texture.env';
await loadCubemapTest(scene, url);
await loadCubemapTest(scene, url);
...
async function loadCubemapTest(scene, url) {
console.log('start loading ...');
return new Promise((resolve, _reject) => {
try {
let tex;
tex = new BABYLON.CubeTexture(url, scene, [], false, [],
() => {
console.log("--> loaded");
resolve(tex);
},
(message, exception) => {
console.log("--> loading error");
resolve();
}
);
} catch(e) {
console.log("--> loading error catch");
resolve();
}
})
}
Playground:
- https://playground.babylonjs.com/#633US3#10
- check console log for “–> loading error”
- this should occur twice