Three.js: Prefetching DRACO decoder in GLTF Loader

Created on 29 Oct 2018  路  2Comments  路  Source: mrdoob/three.js

Currently when a DRACO encoded glTF file is loaded with the GLTFLoader, the DRACO decoder will only be fetched after all of the mesh and texture data has been loaded.

For non-embedded glTF files would it be better to prefetch the DRACO decoder using THREE.DRACOLoader.getDecoderModule() after loading the .gltf file, causing the DRACO decoder to load in parallel with the mesh and texture data? My thought is that this would decrease the perceived load time for the user, while also allowing the DRACO decoder WebAssembly file to compile while the rest of the model assets are loading.

Loaders Suggestion

Most helpful comment

Definitely! I'll get an implementation up and running and compare the network load times.

All 2 comments

Great idea; this should speed things up:

screen shot 2018-10-30 at 8 04 15 am

I think it would be reasonable to prefetch at the end of the GLTFDracoMeshCompressionExtension constructor:

https://github.com/mrdoob/three.js/blob/dev/examples/js/loaders/GLTFLoader.js#L500-L512

Would you be willing to open a PR? :)

Definitely! I'll get an implementation up and running and compare the network load times.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zsitro picture zsitro  路  3Comments

clawconduce picture clawconduce  路  3Comments

jack-jun picture jack-jun  路  3Comments

yqrashawn picture yqrashawn  路  3Comments

makc picture makc  路  3Comments