We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Append multiple scenes with callback

Home Forums Programming Append multiple scenes with callback

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43145
    web
    Customer

    Hey guys,

    I’m working on a bigger project where I started to split the scene into different parts. This way its easier to update specific parts, and multiple people can work on the project.

    At the moment I’m loading one part and on load I append the remaining scenes. This works great, but I would like the preloader to finish when all scenes are loaded/appended.

    I tried putting the appendScene into the “prepareExternalInterface” but that doesnt seem to work.

    Anyone got an idea?

    #43147
    xeon
    Customer

    Hey there,

    So you have a large project that you have broken into several parts to make it easier to work on. Thats a good thing.

    Most browsers are limited to 50Mb some even less unless you are using a customized version of Chromium. So if the combined gltf, bin and textures of all your files exceeds 50MB…then odds are it just wont load for many devices and just time out. Depending on your needs this may or may not be a problem. To avoid this you would want to keep your project in small chunks and load in only what you need when you need it and dump out of memory stuff you don’t need. But I am sure you have already thought about this.

    Based on what I understand, you want to pre-load all your scenes and have the pre-loader monitor the loading of those scenes and associated assets. Since you are aware of the limitations of browser memory then the combination of all the files would be something less than 50MB. So in this situation from a performance standpoint, it might be more efficient to re-assemble all your assets back into one scene and not do the appends.

    However, if it is not a concern you will probably need a custom-coded pre-loader, not the default preloader in Verge Puzzles. This could be done all external or done in Blockly and create a new preloader puzzle. It will need to monitor the available memory the browser can store, validated it against what you are trying to download into it to see if it will fit. If it can fit, download all of it. If it cant fit…check to see if it has enough space to download just the main scene. If not fail gracefully, if ok, use the puzzle logic to load and unload as needed rather than all at once. Its a complex problem that will affect your project from a coding standpoint and from a puzzle standpoint.

    What we have found to be a simple approach is to make the main scene just a scene loader/unloader…very minimal 3d assets. Yes, this means the preloader puzzle will zip by quickly. But then you can create your own simulated loader bar using the append puzzle and the optional “enable on progress” and create your own progress bar inside of verge. You could design it to even look like your prelaoder page if desired. This option gives you great flexibility into controlling loads without custom code.

    Xeon
    Route 66 Digital
    Interactive Solutions

    #43245
    web
    Customer

    Thx for your detailed explanation. I managed to find pretty simple “hack” without two much rewriting.

    I moved the “app.run()” from the “app.loadScene()” into the finish callback from the appendScene(). This way the standard preloader waits until the last appendScene is finished. Tiny drawback is that the progress bar doesnt take all the scenes into account, so the bar jumps to start everytime a new scene is loading. But this approach works with minimal effort.

    #43254
    xeon
    Customer

    Nice….well done.

    Xeon
    Route 66 Digital
    Interactive Solutions

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.