Open bertt opened 4 years ago
testcase: https://bertt.github.io/mapbox_3dtiles_samples/samples/instanced/trees_external_gltf/index.html
error thrown: "Mapbox3DTiles.js:54037 Unexpected end of JSON input" when loading i3dm
i3dm tile have header.gltfFormat == 0 and a reference to external glb https://bertt.github.io/mapbox_3dtiles_samples/samples/instanced/trees_external_gltf/tree.glb
loader was not awaiting external response. Pushed new version. Example set at https://bertt.github.io/mapbox_3dtiles_samples/samples/instanced/trees_external_gltf/tileset.json now works.
tested, it works now. One possible improvement: the same glb is retrieved for each tile, is it possible to retrieve the glb once (and use a cached version for other tiles with same external glb)?
Internal gltf cache added. Risk: requires memory for every new object. Benefit: save many extra requests. For discussion: without internal caching, caching is handled by the browser cache?
@anneb Is it possible to store a reference to the instanced model/mesh instead of the downloaded bytes? This way you won't have the 'risk' of requiring more memory and save time and resources on creating the model from bytes for every tile with the same model.
add support for uri of the glTF in i3dm
Currently only a embedded glTF is supported.
Specs: https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel#gltf
when header.gltfFormat == 0: glTF field contains a uri of the glTF when header.gltfFormat == 1: glTF field contains bytes of the glTF