Noticeable Difference in Environment Texture After Clicking in Inspector

Hi everyone,

I’ve noticed a strange behavior when using high-resolution environment textures (like 2K .env files). After the environment texture is loaded and applied to the scene, if I interact with the Inspector, there’s a noticeable visual difference.

Specifically, if I open the Debug Inspector, go to Scene > Env. Texture, and click the texture link , the scene immediately updates. Expecially when using a PBR material with high metallic and low roughness values, the visibility of reflections noticeably improves.

To illustrate this, I set up a minimal Playground example:

Steps to reproduce:

  • Run the scene normally
  • Open the Inspector (top-right button)
  • Go to Scene > Env. Texture and click on the texture
  • Notice how the scene appearance subtly but clearly improves right after

A video of the process is showed below:

I tried to apply Environment Texture both using the CubeTexture constructor and using createDefaultEnvironmentFunction, having the same results.

I’m wondering:

  • Is this expected behaviour or a bug?
  • Does the Inspector interaction somehow force a reload or rebind of the texture?
  • Is this behavior something that can be controlled programmatically, for example through options in the CubeTexture constructor?

Any insight would be appreciated. Thanks in advance!

This feels like a bug indeed, I will have a look ASAP.

This is an inspector bug where the texture mipmaps is recreated when selecting the texture which results in erasing the prefiltered information there. I am having a quick look but might handover to @georgie soon :slight_smile:

1 Like

This is the change who generated the issue Fix bug when update sampling was not taking mip map generation in acc… by deltakosh · Pull Request #16419 · BabylonJS/Babylon.js · GitHub I am trying to see how to best fix it

This will fix it: Fix IES texture sampling mode and Mipmaps generation by sebavan · Pull Request #16870 · BabylonJS/Babylon.js · GitHub

2 Likes