<a-asset-item> preload vs inline gltf-model URLs for many identical models on limited bandwidth
0 reputation · 06 Nov 2024, 20:50 UTC
0 reputation · 06 Nov 2024, 20:50 UTC
Goal is to render many identical GLTF entities in A-Frame under a limited bandwidth constraint while balancing first model visibility against duplicate network requests.
One approach uses <a-asset-item> inside <a-assets> and references the asset by selector with gltf-model="#id" on multiple entities. The other approach sets gltf-model="url(model.glb)" inline on each entity.
The asset approach is documented to download the GLTF once for reuse by selector references. The inline approach lets entities start loading without waiting for a central asset block, but A-Frame’s gltf-model component relies on three.js GLTFLoader and does not itself guarantee deduplication of in-flight identical URLs. Preloading can delay first visibility until assets resolve, while inline URLs can cause pop-in as individual loads finish.
With A-Frame 1.x assumptions, it is unclear when parsing into a three.js scene occurs relative to asset load, and whether referencing an asset id before its load event leaves entities without a model until resolution. There is also no documented scene-wide "all assets ready" signal.
Does referencing the same <a-asset-item> id guarantee a single network fetch for many entities under constrained bandwidth? When does GLTF parsing happen relative to the asset load event, and is memory shared across selector references? Is there a reliable way to know when all <a-asset-item> assets are ready before entities become visible?
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.