Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefetching DRACO decoder in GLTF Loader #15168

Closed
TyLindberg opened this issue Oct 29, 2018 · 2 comments
Closed

Prefetching DRACO decoder in GLTF Loader #15168

TyLindberg opened this issue Oct 29, 2018 · 2 comments
Assignees

Comments

@TyLindberg
Copy link
Contributor

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.

@donmccurdy
Copy link
Collaborator

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? :)

@TyLindberg
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants