EquiRectangularCubeTexture not loaded with delay load

Version: 8.56.1 (but might be all)

Playground:

Steps to reproduce:

  1. Open the playground: https://playground.babylonjs.com/#RY8LDL#73
  2. Just watch it (It never loads)

Expected:
It loads just like scene.useDelayedTextureLoading = false;

Actual:
Nothing rendered.

Suggested fix:
Add override delayLoad for it, test it on playground:

Misc:
An AI powered search taking 2 hours through the whole repo says EquiRectangularCubeTexture is the only texture where delayed load not working, and I happened to met it.

The raw AI output if anyone instested

Only one texture has the bug pattern you described:

EquiRectangularCubeTexture (equiRectangularCubeTexture.ts)

  • Constructor (line 84-88): When scene.useDelayedTextureLoading is true, sets delayLoadState = DELAYLOADSTATE_NOTLOADED and skips _loadImage()
  • No delayLoad() override — inherits the empty stub from ThinTexture
  • Result: When isReady() is called (line 179 of thinTexture.ts), it invokes the no-op delayLoad(). The texture is stuck in DELAYLOADSTATE_NOTLOADED forever and never loads.

All textures that check useDelayedTextureLoading

Texture Sets NOTLOADED? Has delayLoad()? Status
Texture Yes (line 544) Yes (line 610) Correct
CubeTexture Yes (line 375) Yes (line 387) Correct
EnvCubeTexture Yes (line 173) Yes (line 346) Correct
ColorGradingTexture Yes (line 59) Yes (line 267) Correct
EquiRectangularCubeTexture Yes (line 87) No Broken

HDRCubeTexture and EXRCubeTexture extend EnvCubeTexture and properly inherit its delayLoad() — the virtual _getCubeMapTextureDataAsync() dispatches correctly to each subclass, so they work fine.

All other texture subclasses (RawTexture, DynamicTexture, VideoTexture, RenderTargetTexture, ProceduralTexture, HtmlElementTexture, etc.) never set delayLoadState = NOTLOADED and don’t delay creation, so they don’t need a delayLoad() override.

And a PR with suggested fix:

2 Likes