Jump to content

loading & using assets with several scenes/canvases


aWeirdo
 Share

Recommended Posts

Hi all,

i was wondering, is it possible to use assets loaded outside of the current scene/canvas?

As an example, lets say i have 3 canvases:

Game with several 3d characters/models you can control/play.

When you login, a loading scene is displayed (canvas 1), all assets are loaded into a global assets object/array.

When you then want to choose a 3d character/model, you can preview them in a second canvas (canvas 2), 

When you have selected a character/model, you can enter a game session (canvas 3).

 

Is it possible to load the assets in canvas 1, then display/use them in canvas 2 & 3 via the global assets object without having to load them again?

Link to comment
Share on other sites

Ok, thanks @Deltakosh,

i read something about manifests for .babylon files some time ago, isn't there something about it being stored in client browser cache or something? e.g. if version 1.0 have been loaded into memory, if you try to load it again and it's still version 1.0, it uses the stored file instead of downloading it all over, or did i misunderstand / is that only for the same canvas?

 

Link to comment
Share on other sites

Ok cool, so in theory, my idea of loading all models at login should work right?

Except instead of using the models from assets, i suppose it would simply use the already loaded model when trying to load it again in the other canvases.

i guess that's just as good, the entire point was to minimize loading times when switching between previews of different models & bandwidth use by continuesly loading models over and over again.

 

Thanks again, I appreciate the help :) !

Link to comment
Share on other sites

Is it possible? Yes.  Does Babylon naturally support it? No.  Is it hard to deploy eeeeeeehhhh that's dependent on your level of competence on Extension of objects and how to pack and unpack json... Technically you could construct a project file but your on your own to do it.  I have accomplished what your asking for but a simple explanation is not there... I guess to get you started I would say create a global object class that you can call and load a json file into and have that object construct your scenes.  You can package textures, sounds, and objects all as raw data in a single manifest file.

 

can I, will I show you my method? No.  You will be able to see my method showcased here soon when I launch my project to the public.  I want to finish a few features before release so at least a week I'd say but yea if you can follow my code, you will see how to do it. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...