aWeirdo Posted April 2, 2016 Share Posted April 2, 2016 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 2, 2016 Share Posted April 2, 2016 Hello, unfortunately no. Assets are linked to the engine which is blinked to webgl which in turn is linked to the canvas. There is no fast way to reuse assets between contexts(canvas) unless using serialization Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted April 2, 2016 Author Share Posted April 2, 2016 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 2, 2016 Share Posted April 2, 2016 nope you are correct. By default assets are saved locally inside indexedDB aWeirdo 1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted April 2, 2016 Author Share Posted April 2, 2016 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 ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 3, 2016 Share Posted April 3, 2016 You are correct Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 4, 2016 Share Posted April 4, 2016 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. 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.