immersive-web / model-element

Repository for the <model> tag. Feature leads: Marcos Cáceres and Laszlo Gombos
https://immersive-web.github.io/model-element/
Other
66 stars 12 forks source link

Lazy loading #44

Open marcoscaceres opened 2 years ago

marcoscaceres commented 2 years ago

Some <model>'s resources can be significant in size. As such, it might be good to support the loading attribute to allow these resources to be lazy-loaded.

mikkoh commented 2 years ago

Would this attribute also define loading for the poster?

marcoscaceres commented 2 years ago

Maybe... I guess that would make sense. At least, we could say, "lazy load the poster first when in view, then the model".

cabanier commented 2 years ago

Are there other formats that loads subresources? (SVG images?) Since rendering and parsing happens outside the UA, it seems the loading of subresources is complicated.

donmccurdy commented 2 years ago

Many formats include sub-resources of some kind. glTF files cannot reference other glTF files, but might reference:

External textures — textures shared by many models can be requested and cached independently. Or the model might contain KTX2 or WebP textures, with fallback to PNG or JPEG if the better formats are not supported.

External binary buffers — a user might separate the binary resources for animations into separate .bin files so they are not downloading more than they need up front, among other use cases.

That said, we could prohibit external resources. Most formats are also able to embed everything in a single binary file if desired. OBJ+MTL is the only exception I'm aware of that cannot be packaged as a single file.

cabanier commented 2 years ago

Many formats include sub-resources of some kind.

I meant in a regular browser :-) There's HTML using an iframe which is very complex. I believe SVG images don't allow subresources.

That said, we could prohibit external resources. Most formats are also able to embed everything in a single binary file if desired. OBJ+MTL is the only exception I'm aware of that cannot be packaged as a single file.

+1