Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i3dm: add support for uri of the glTF #35

Open
bertt opened this issue Oct 13, 2020 · 5 comments
Open

i3dm: add support for uri of the glTF #35

bertt opened this issue Oct 13, 2020 · 5 comments

Comments

@bertt
Copy link
Member

bertt commented Oct 13, 2020

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

@bertt
Copy link
Member Author

bertt commented Oct 19, 2020

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

@anneb
Copy link
Collaborator

anneb commented Oct 19, 2020

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.

@bertt
Copy link
Member Author

bertt commented Oct 19, 2020

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)?

@anneb
Copy link
Collaborator

anneb commented Oct 20, 2020

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?

@tebben
Copy link
Collaborator

tebben commented Oct 20, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants