Race-condition with loading scene textures

When I’m loading a scene (via BABYLON.SceneLoader.Load) which contains 65 textures I’ll get a
“RENDER WARNING: texture bound to texture unit 4 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.”

If I render after a timer of a few seconds I don’t get that warning. I assumed the “executeWhenReady” block would execute only after all the data has been loaded, so I think this is a bug.

This is possible but I’ll need a repro on the PG to fix it :slight_smile:
Pinging @sebavan to track this issue

Yup would be amazing to have a repro cause it sounds like a bug.

I was building a repo then realised that SceneLoader and the 65 textures had nothing to do with it. I have a race condition somewhere else. I’m loading an avatar then in the “success” block of the ImportMesh function I’m creating shadows. The shadows was causing the error. I just put the shadow creation tool inside AvatarMesh.registerAfterRender to make sure the texture is displayed first before I create shadows. I don’t have any errors now.