Convergence Posted April 19, 2018 Share Posted April 19, 2018 Say you have a project that loads has a large number of meshes, for example furniture, each with their own (multi)material. Now the actual scene only displays a select few of the loaded meshes according to what the user wants to see (eg. house blueprint). However all the vertices of all meshes and all textures of all materials are loaded into memory, which of course increases the memory consumption quite a bit. I've tried using the meshName filter of the ImportMesh call, but that increases the scene loading time by quite a bit since it will reload and reparse the .babylon file for every asset used in the scene to load the specific mesh. Additionally if the user wants to add another asset to the scene after the initial load, the .babylon file will have to be called yet again. Then I tried to at least dispose() all materials of all unused assets to free up the texture memory after loading them, and only recreate the required material if a mesh is actually enabled in the scene (by storing the texture url in an array), but mass disposing of materials/textures that are not yet done loading causes quite some quirks in the babylon scene where the textures are sometimes applied to random other meshes and even random renderTargetTextures like my shadowgenerator. Any ideas on how to reduce the memory footprint? Thanks in advance Quote Link to comment Share on other sites More sharing options...
Guest Posted April 19, 2018 Share Posted April 19, 2018 What about having a file per furniture? Quote Link to comment Share on other sites More sharing options...
Convergence Posted April 25, 2018 Author Share Posted April 25, 2018 Hmm, that is quite the commitment , to export every mesh out of hundreds individually Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted April 25, 2018 Share Posted April 25, 2018 Don't you need to split it anyway to avoid network latency ? ^^' Quote Link to comment Share on other sites More sharing options...
Arte Posted April 25, 2018 Share Posted April 25, 2018 @Convergence You can control everything by tags (mesh, material, multimaterial ...). With tags I never had a problem. For loading "file per furniture", best option. 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.