Got wrong mapping in EquiRectangularCubeTexture

Please check the PG:

I got some problem playing with EquiRectangularCubeTexture.

When I instantiate a texture with the same panorama picture before instantiating the EquiRectangularCubeTexture. The cube texture shows the wrong result.
It happens when two different type of textures have the same url/invertY/sampleMode/…

This problem seems to be relative to the texture cache, but there is no simple way for me to invalidate the cache before using the image again.

Here is the panorama picture:

let PANORAMA_URL = “textures/equirectangular.jpg”;
// ‘panoTex’ makes ‘envTex’ break
let panoTex = new BABYLON.Texture(PANORAMA_URL, scene);
// we’ll see a wrong reflection
let envTex = new BABYLON.EquiRectangularCubeTexture(PANORAMA_URL, scene, 256);
scene.environmentTexture = envTex;

Hello and welcome to the Babylon community! Thanks for the report, I’ll take a look at it.

PR up Fix texture caching. by carolhmj · Pull Request #12652 · BabylonJS/Babylon.js ( :slight_smile:

1 Like

Thanks for the reply =D

1 Like

You’re welcome!