immersive-web/model-element

Lazy loading

marcoscaceres opened this issue · 5 comments

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.

Would this attribute also define loading for the poster?

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

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.

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.

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