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
62 stars 11 forks source link

Lazy loading #44

Open marcoscaceres opened 1 year ago

marcoscaceres commented 1 year 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 1 year ago

Would this attribute also define loading for the poster?

marcoscaceres commented 1 year 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 1 year 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 1 year 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 1 year 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