Shared GLB between I3DM/CMPT tiles

Hi All,
I have 3D Tileset representing trees. It is composed of CMPT tiles, each one containing several I3DM tiles.
For each tree specie, I have a position in an I3DM tile, an associated external GLB model (and some specific scale and rotation values).
All the trees with the same specie points to the same GLB file/url.
My goal for doing that is load each model only once, assuming that loaded models will be shared between the tiles (both in terms of loading and in terms of internal representation).

1/ I’m wondering why the loader adds a ‘compositeIndex’ to the url when fetching the GLB. For example the requests looks like :
https://planner.luxcarta.online/demo/3dtiles/mourmelon_trees/PlatanusOccidentalis_lod2.glb?compositeIndex=1&v=1.0
https://planner.luxcarta.online/demo/3dtiles/mourmelon_trees/PlatanusOccidentalis_lod2.glb?compositeIndex=2&v=1.0
It seems that the value correspond to the position of the I3DM file in the CMPT one. Why the urls include that value ? This triggers a lot of request for the exactly same 3D model.
Additionally, a request is emitted for each GLB of each I3DM even if the model url is the same (same compositeIndex).

2/ Am I wrong assuming that if the same GLB is used in several tiles, it should be shared by all of them ?

3/ What if the recommended way to structure a such dataset (instanced models for trees, cars, …) ?

Any hints appreciated,
Fred.

Hi @ftrastour,

Thanks for bringing this to our attention. This sounds like a corner case we hadn’t considered so I opened this issue: `compositeIndex` query parameter hurts browser cache performance for external resources. · Issue #10875 · CesiumGS/cesium · GitHub

The query parameter was added for a technical reason. the new Model architecture maintains a ResourceCache of resources, and the cache key involves the URL of the file. Without the query param, there were cases where the glTF JSON was shared when it wasn’t supposed to be, leading to rendering bugs like duplicate geometry.

I fixed that in Fix composite tile caching in `ModelExperimental` by ptrgags · Pull Request #10524 · CesiumGS/cesium · GitHub by adding the compositeIndex query parameter to the Resource (which was the most straightfoward way to distinguish the cache keys). However, I see now that the external GLB in the i3dm inherits this query parameter, which is bad for browser caching.

As for your other questions, the way you structured your data sounds fine, this is a CesiumJS bug.

As a side note, in 3D Tiles 1.1 (see the draft specification) you can also use multiple contents per tile in the tileset JSON. This makes data authoring easier, one less binary format to generate (compared to cmpt). On the other hand, each inner content is a separate request. Multiple contents is available in CesiumJS. It would be a workaround for your browser caching issue, but if you have many i3dms per tile, then it might not help with reducing the number of requests.

Best,
Peter

Hi @ptrgags,
thanks for your explanations.

Regarding : “As for your other questions, the way you structured your data sounds fine, this is a CesiumJS bug.“, should I submit an issue for that ?

BR,

Fred.

@ftrastour No need, the issue I linked to above is the bug I was referring to.

-Peter