I have about 50 GLTF models (glb) that I use to create a scene over about 2 square miles, rendered in Cesium JS. Some of these models are trees and are loaded multiple times with different rotation/scales for variety. Overall, a single scene may display well over 5,000 models. My models have been optimized as much as possible already (e.g. compressed, webp, meshs are bare minimum), and each model is less than 100KB in size. Some of my models use the same image textures. The user experience in the app will be at ground level (as if someone were standing and looking around), rather than an overhead view, so I would expect that tiling this data makes sense as there will be a lot of area not visible at any single location. I’m starting with a single scene but expect upwards of 50,000, so trying to create an automated pipeline for this. I have lat/lon values for the location of every model in the scene already in a database. I’ve been trying to figure out the best approach for how to ensure the best performance possible, but I’ve seen a lot of conflicting advice around, mainly due to things changing over time. Here are the different approaches I’m looking at. Please let me know if my understanding is correct and
- Load models directly into Cesium JS, no tiling
- Simple to achieve and since my models are small, the network loading time would be low.
- Likely not taking advantage of instanced modeling and loading the same model several times. It’s already taking 30+ seconds to load the scene.
- Loads the whole scene, not just the area the user is close to which would mean more memory usage.
- This works, but likely not the most optimal solution.
- Create a KMZ for the scene and import into Cesium ION to create tiles.
- Would need to convert my GLB to Collada files and capture all the texture files. Keep this all organized and create KMZ file accordingly. Cesium ION would then convert my models back to GLTF, then to 3D tiles.
- Since many of these models are close together (e.g. dense treed area), several of the same models, or models that use the same textures, will end up in the same 3D tile. The models should be instanced and thus more performant than if I were loading them individually like I am currently.
- With a bit of work I should be able to automate this scene creation process.
- Create one giant GLTF and then convert to tiles
- I also have terrain data and base map imagery in my app. I could potentially combine this with the models and create the full scene in Blender, then export as a single GLTF. This would be similar to the Google Maps 3D tiles, where there is only one model in each tile that contains a cutout of a larger model. I would have to use the terrain data in Blender anyways with this approach since I would need to set the elevation of each model relative to each other. Then upload that to Cesium ION and create 3D tiles (I believe this model would be chopped up into chunks per tile). This would give me the benefit of reducing the number of network requests from 3 per tile area (terrain, base map imagery, 3D model tile) down to one.
- Maybe a bit more work to get things to align with the surrounding area (e.g. I fallback to low res terrain and imagery in areas outside of the main scene) and would need to ensure things look file elevation wise.
- I suspect this approach will be a lot more manual, and harder to automate.
I suspect #2 is the path that would be ideal here, please correct me if I’m wrong.
Also, in my app I have some other assets that would be in addition to this:
- I have some geometry objects. I’m currently using primitives for this in the Cesium JS control. I found KMZ in Cesium ION doesn’t support geometries. I did see some experiments on Github where people were creating 3Dtiles from geometries, so I might be able to do that, then combine the two #d tile sets together.
- I have a few models that are time dependent (animations, or event drive), that I would still load directly. I would likely only have 4 or 5 of those loaded at any one time. I also expect that I would change these assets from time to time (position, model being used…) so it wouldn’t make sense for these to be in the main 3D tile set for a scene.