Loading multiple single .glb files


I have a project where I load multiple single .glb files into a single scene. Inside a for-loop (in which I iterate over every file) I load every single file with
BABYLON.SceneLoader.LoadAssetContainer("path", "file.glb", scene, function (container) { }); into a container. After the for loop is completed i add all Eelemnts inside the container with container.addAllToScene();

My Problem is now that the files get loaded all really slow into the scene and not as a complete mesh but as a single mesh each single one. The process of the loading takes up to much time.

What is the optimal way of loading multiple single .glb files?
Is it possible that the reason for the slow loading process is that i try to load multiple single meshes?

Could you create a repro on the playground ? it might be easier to troubleshoot ?

1 Like

After some resarches we realised that the solution for it probably will be merging multiple gltf arrays into one big array. Now what is the easiest solution for that?

How much does the .glb file weigh?

They are gltf files and are around 20 KB.

@Patrick_Luthi You most likely want to load the meshes asynchronously. See:

SceneLoader - Babylon.js Documentation

As opposed to SceneLoader.LoadAssetContainer, which blocks your application thread until a single mesh has loaded before beginning loading the next one.

Don’t listen to me, both apis behave identically under the hood.

Just to close it and if someone is searching for the solution: Load multiple files fast