You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a result, all accessors (which in turn depend on all of the .bin buffer files) will be loaded before any meshes can be created. This introduces a problem, if not all buffers are actually needed. For example:
The (draft) KHR_draco_mesh_compression extension allows an asset to include a Draco .bin file, and an uncompressed .bin, so that that clients not supporting Draco can still fall back on the unoptimized version. In either case, we want to load only one of the buffers.
The (draft) MSFT_lod extension has essentially the same problem.
It is already valid, although I haven't seen any examples, to declare both metal-rough and spec-gloss materials on the same mesh.The loader can choose which to use, according to performance and feature support, but you certainly don't want to request the textures for both. Currently, this is exactly what GLTF2Loader would do.
So, I think it might be necessary to restructure GLTF2Loader to request dependencies top-down. Proposed syntax (unless there are good existing examples to imitate) would be something like this:
^Using ES6 for conciseness, although presumably that can't actually be checked into examples/js.
Before I embark on a journey of refactoring, any strong preferences on how this should work? I'm hoping, but will need to verify, that this change could happen incrementally.
I think this can be closed. Some parts are not strictly top-down — for a model with multiple scenes, we might someday want to not have nodes or accessors retrieved via getMultiDependencies(). But for all example models I've seen so far, the current structure looks much better.
The current pattern in GLTF2Loader looks something like this:
As a result, all accessors (which in turn depend on all of the
.bin
buffer files) will be loaded before any meshes can be created. This introduces a problem, if not all buffers are actually needed. For example:.bin
file, and an uncompressed.bin
, so that that clients not supporting Draco can still fall back on the unoptimized version. In either case, we want to load only one of the buffers.So, I think it might be necessary to restructure GLTF2Loader to request dependencies top-down. Proposed syntax (unless there are good existing examples to imitate) would be something like this:
^Using ES6 for conciseness, although presumably that can't actually be checked into examples/js.
Before I embark on a journey of refactoring, any strong preferences on how this should work? I'm hoping, but will need to verify, that this change could happen incrementally.
/cc @takahirox
The text was updated successfully, but these errors were encountered: