ErrorHandler for CreateFromPrefilteredData

Hello fellow babylonians,
I am loading an environment via the

BABYLON.CubeTexture.CreateFromPrefilteredData(url, scene)

Now there was an typo in the url and unfortunately there seems to be no handler to output such an error, or is there?
Any workaround if there isn’t one?


pinging @sebavan

CreateFromPrefilteredData is a short hand method only. To get more information, like error and load handlers, you can rely directly on the CubeTexture constructor:

const texture = new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);

Would that fit for you ?

Ah, i see, Thanks.
I am not sure as how to go about with this.
What I am trying to load is a env file ( like the one in the playground )
So the shorthand code would be:

Copy to clipboard

this._scene.environmentTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("./assets/my_environment.env", this._scene);

But how do I go about with the normal constructor?
I tried this:

Copy to clipboard

let cube new BABYLON.CubeTexture("./assets/my_environment.env", this._scene, null, false, null, (e) => console.log("loading:",e), (e) => console.log ("error:",e),null,true);

But that did not fire either the load or the error handler but it did load the .env file.

Ohhhh This is an issue then :slight_smile: Could you create a small repro in the playground so I ll have a look ASAP ???

i added an example ( )
But there it works.
Maybe it does no with my local file because i am still on V4.1.0