What are all the ways to improve the loading speed of models and textures

Hi all,
I hope there are many tricks to improve the loading speed of models and textures, Kindly share here.
My scene is having nearly 20 .glb Models and 60 .webp Textures .

As you’ve hope, there are definitely many different ways to improve on loading of models :slight_smile: Cacheing, DRACO compressed meshes Draco 3D Graphics Compression (google.github.io), Incremental Loading Incremental Loading System | Babylon.js Documentation (babylonjs.com), progressive loading, Progressively Load .glTF Files | Babylon.js Documentation (babylonjs.com) and decimating your geometry Decimate Modifier — Blender Manual :slight_smile:

I am assigning nearly 100 materials for those 20 glb models. Will it be the cost of time for loading? Any tricks to assign material quickly. Now I am having the materials as a json file. While loading the model, at the callback function, I am getting the material detail from the json based upon the material name, then assigning that.

If you mean initial loading speed, I think level of detail on your textures is going to give you largest impact. For my company we start at 256px maps just to get something rendering on the screen and then start working up to 2048 over a few progressive steps

1 Like

There is a lot to unpack here. It really depends on the scenario. When you say “loading”, are you considering the download also? Are the assets local? The best way to improve the “loading” speed depends greatly on whether download size / disk footprint is a consideration.

@bghgary . Actually, all the assets are within the project and not needed for downloading. The total size of the assets nearly 45mb. Even though the assets are local, it takes nearly 10 to 15 seconds.

1 Like

Alright. The next step is to capture a performance profile using Chrome Dev Tools or something similar and see what is slow. For example, if you see that decompressing the texture is slow, then it will be better if you store the textures in a GPU format (one per platform, as opposed to webp, which is good for download, but will take time to decode to raw GPU format).

@bghgary I have attached the performance profile. Could you please help me to find out the issue?

I’m afraid this won’t happen;) not just with this screenshot. Obviously, the script is taking 75% of performance and the script is (well, the script). Long live js :face_with_open_eyes_and_hand_over_mouth: where it’s just impossible to detect what exactly is causing this… At least, not with just this SS.

1 Like

Here’s a simple recommendation:
Rather than loading 20 models 20 times each with 45mb
It will take faster if you add them up and divide them into 4 and load them 4 times, or load them all at once.

Or please see other methods in the following link :

1 Like

I am not loading each model with 45 mb. I am saying the total size of the assets.

There seems to be a translation problem
It means that it is recommended to load 45MB in 4 divided portions rather than 20 divided loadings.

How to load like that. I am having 20 glb files. So I need to change the files into 4 glb files. right?

yes that’s what i want to say

1 Like

But, If I load model without assigning any material. The loading time is very low. While assigning material only, the delay is too long.

Can you share a repro or a profile? We need to know what is slow before suggesting solutions.

@bghgary . Sorry, It is an official project, So I couldn’t share. Hope you understand.
I tried without assigning material, at that time it takes 3sec to load.
Then I tried with material but without any texture properties, at that time it takes 6sec to load.
Then I tried completely compressed textures with .jpg format at that time it takes 12 sec to load.

We cannot help you without a repro. Maybe you can try to reproduce the issue with dummy or stuff you can share?

It is like asking a doctor to heal you without showing the problem :slight_smile: