Three.js: How to track dependencies while using GLTFLoader

Created on 18 Apr 2018  路  2Comments  路  Source: mrdoob/three.js

Description of the problem

Hi,

I'm using a pretty big glTF scene with the following files and sizes:

  • gltf file (around 700 KB)
  • bin file (geometry - around 10 MB)
  • texture files (around 120 separate jpg files, they're around 5 MB together)
  • So everything together is around 16 MB

Now I'm trying to make a progress indicator, so the user can get an idea on how the loading goes. The problem is that the onProgress method of the GLTFLoader runs only for the gltf file itself, which is about 4-5 % (700 KB / 16 MB) of the whole scene, so progress.loaded / progress.total already gives 100%, when there is a bunch of other things left to load.

Is there a way to get a loaded / total value for the whole scene (including the bin file and the textures)?

Thank you

Most helpful comment

If you pass a LoadingManager into the constructor for your GLTFLoader, you should be able to use its onProgress callbacks for other resources.

All 2 comments

If you pass a LoadingManager into the constructor for your GLTFLoader, you should be able to use its onProgress callbacks for other resources.

You're right, thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

konijn picture konijn  路  3Comments

danieljack picture danieljack  路  3Comments

makc picture makc  路  3Comments

ghost picture ghost  路  3Comments

akshaysrin picture akshaysrin  路  3Comments