I am using BABYLON.SceneLoader.Load to load a scene. I receive the callback with the scene.
But for some 500ms-1000ms some things are still not visible on the scene.
They are there and a bounding box could be drawn around them, but they are not visible yet. My questions is:
Is there a way to wait for the whole scene and everything with the scene to be loaded? Is this expected from BABYLON.SceneLoader.Load and is it loading all the things?
(note: I don’t know what “all these things” could be. I am guessing here)
I believe you are observing that load has completed, but not all of the textures have and or material shaders have compiled yet.
- Stop using Load, use Append, where you create the scene first youself, then pass it to Append(). This allows for loading more than one file.
- Stop using the callback arg. It makes more complicated, especially if you have more than one file.
- Add a scene.executeWhenReady(), after all your Appends, to have a single callback.
Thanks. Changing to Append might be too big of a change for us at this stage but will try it. When we were initially implementing it Append did not work for us, but things might have changed since then.
Do you think we could get the same result it we call Load, get a callback and in the callback register a scene.executeWhenReady()?
It worked perfectly - I continue using Load but to a scene.executeWhenReady()
@JCPalmer is there a way for us to test that a scene is still not ready? We need a regression spec that we are executing our code in executeWhenReady()? How do we understand that it is still not ready?
scene.isReady() will return false. That is partially how
scene.executeWhenReady() is implemented.