FlashyGoblin Posted October 17, 2016 Share Posted October 17, 2016 Has anyone had any problems with scene animations running while loading textures? I have a .babylon scene loading. Then when the scene is ready, I start an animation, while loading some additional textures. (The reason is that I want the scene to load with low res textures for faster start up, and then load higher res textures later.) It seems that whenever a texture is loading, it delays any animations from running (like the camera transitions) until the textures are finished loading. Even when an animation is started before the load, it will wait till all loading is finished, and then does the animation. This becomes a problem when we want to initially show the scene animate things while the high res textures are loading. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 17, 2016 Share Posted October 17, 2016 Hey this is because of this line: https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L1209 The animation engine will not start until everything is ready. Just set scene._pendingData = [] should fix your issue Quote Link to comment Share on other sites More sharing options...
FlashyGoblin Posted October 18, 2016 Author Share Posted October 18, 2016 13 hours ago, Deltakosh said: Hey this is because of this line: https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L1209 The animation engine will not start until everything is ready. Just set scene._pendingData = [] should fix your issue Thanks David! However that doesn't seem to do the trick. I'm animating the camera when the scene is ready via an animation. I start the animation right away, and then I start loading new textures. Only after the textures are finished loading does the camera animation start. Quote Link to comment Share on other sites More sharing options...
FlashyGoblin Posted October 18, 2016 Author Share Posted October 18, 2016 Doh, it DOES work!! I was putting it in the wrong place. I had to add that line directly after each of my new BABYLON.Texture() calls, and not once after my for loop of them. Thanks @Deltakosh!!! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 18, 2016 Share Posted October 18, 2016 My pleasure! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.