DezOnlyOne Posted January 25, 2016 Share Posted January 25, 2016 In my application I have animation packages(babylon files) that are very large and take a while to download from the server. This download time is helped by using the enableSceneOffline and enableTexturesOffline in the manifest file, but we still have to deal with the initial load each time. Is there a way to load those so they are available in the background without having to render them on screen until we are ready for the user to interact with them? The load times are excessive for each package, but it would help if I could load a new babylon file to have it ready for when the user is done interacting with the first. Quote Link to comment Share on other sites More sharing options...
davrous Posted January 25, 2016 Share Posted January 25, 2016 Hi, You can simply call BABYLON.SceneLoader.Load() in the background and don't do anything in the callback. If you've set a manifest + enabling offline on the engine (by default), our loader will download the scene & assets and store them in IDB. This will preload your scene thus. Is this what you'd like to achieve? Bye, David Quote Link to comment Share on other sites More sharing options...
DezOnlyOne Posted January 25, 2016 Author Share Posted January 25, 2016 Almost. What if I am using Import Mesh? I have a hospital room that is already loaded. I am just swapping out the patient in the room. Does this apply to BABYLON.SceneLoader.ImportMesh() as well? Quote Link to comment Share on other sites More sharing options...
davrous Posted January 26, 2016 Share Posted January 26, 2016 Yes, ImportMesh goes through the same IDB layer. Quote Link to comment Share on other sites More sharing options...
DezOnlyOne Posted January 26, 2016 Author Share Posted January 26, 2016 4 hours ago, davrous said: Yes, ImportMesh goes through the same IDB layer. I tried to use the import mesh without a callback, and it still rendered the mesh on screen. I want to be able to load it into the IDB without rendering it on screen at all. I tried with the importMesh Skull example on babylonjs-playground BABYLON.SceneLoader.ImportMesh("", "scenes/", "skull.babylon", scene); I attached the example I downloaded and edited. skullTest.zip Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 26, 2016 Share Posted January 26, 2016 Why not load the model and make it invisible with visibility = false. this way it is loaded and not rendering on the scene. Quote Link to comment Share on other sites More sharing options...
DezOnlyOne Posted January 26, 2016 Author Share Posted January 26, 2016 20 minutes ago, Dad72 said: Why not load the model and make it invisible with visybility = false. this way it is loaded and not rendering on the scene. The babylon files I have are very large, and contain several thousand frames of animation. If I try to load them in that manner, I get an OOM error. I can only load these 1 at a time. Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 26, 2016 Share Posted January 26, 2016 Try to use the binary format : http://doc.babylonjs.com/tutorials/09._Using_the_Incremental_Loading_System Quote Link to comment Share on other sites More sharing options...
DezOnlyOne Posted January 26, 2016 Author Share Posted January 26, 2016 1 hour ago, Temechon said: Try to use the binary format : http://doc.babylonjs.com/tutorials/09._Using_the_Incremental_Loading_System I will try to clarify what I am doing. I have a hospital room where the room is loaded separately from what I am calling "animation packages". An animation package is simply a virtual patient mesh with several animations that a user will play at different times in a scenario. Each one of the animation packages are different, in that they contain different animations for different parts of a scenario. What I want to do is load animation package A, and while the user is working with package A, I want to be loading package B into the IDB so it is available when packageA is complete. I am not sure if making the package incremental will help all that much except for when the loading fails. What makes this issue worse is that the animation packages are well over 100MB, so I am getting OOM errors when trying to load multiple animation packages at the same time. A package needs to be completely flushed from the scene before a new one can be loaded dependably. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 26, 2016 Share Posted January 26, 2016 Perhaps more assetManager would fit in this case. http://doc.babylonjs.com/tutorials/How_to_use_AssetsManager You will probably have to create your own function in more to get what you want to do. Quote Link to comment Share on other sites More sharing options...
DezOnlyOne Posted January 27, 2016 Author Share Posted January 27, 2016 20 hours ago, Dad72 said: Perhaps more assetManager would fit in this case. http://doc.babylonjs.com/tutorials/How_to_use_AssetsManager You will probably have to create your own function in more to get what you want to do. The assets manager is a pretty cool, and will have a use sometime down the road for other projects, but for these particular files, I get an OOM crash from just adding the tasks to the AM. I don't even need to load anything. I have had this issue before. There is just too much animation in these files I suppose. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 27, 2016 Share Posted January 27, 2016 Or maybe your object is too detailed. WEBGL a limit of 65536 triangle by object. Quote Link to comment Share on other sites More sharing options...
DezOnlyOne Posted January 27, 2016 Author Share Posted January 27, 2016 4 hours ago, Dad72 said: Or maybe your object is too detailed. WEBGL a limit of 65536 triangle by object. I am at about 23k polys per animation package, but that can add up quickly Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2016 Share Posted January 28, 2016 Is there a way to see it live? Quote Link to comment Share on other sites More sharing options...
DezOnlyOne Posted February 11, 2016 Author Share Posted February 11, 2016 sorry, I did not see this last post. http://protest.jht.com/duke/pkgTest/dev.html http://protest.jht.com/duke/pkgTest/engine.js 1. Choose a scenario 2. click continue 3. you can choose any test Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 11, 2016 Share Posted February 11, 2016 It works for me what should I do to get the bug? 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.