1. A concise explanation of the problem you’re experiencing.
I am attempting to render large swaths of woods on a hilly landscape.
If performance was not an issue, I would do this client-side and use a single GLTF model of a relatively low-poly tree and instantiate it hundreds of times by generating a large array of points that I would create elsewhere i.e. QGIS and add in randomization for heading and scale (0.8-1.2 probably). Thanks in large part to Cesium.HeightReference.RELATIVE_TO_GROUND, I can have all of the trees clamped to ground, such that I only need to worry about placement in two dimensions.
However, as you could imagine, rendering 500+ walnut trees would be enormously process-intensive, even on a relatively low-poly model. So I looked to 3DTiles.
After learning how Ion does things, I figured I could maybe upload one GLTF of a tree and then instantiate it several times client-side and translate it on the fly. I found some snippets on translating them client-side- but since there is no client-side clamping-to-ground setting, and because I haven’t figured out a proper method of determining the height that each 3DTileset would need to be for it to them to be on top of the ground, the best I can do is a 2-dimensional mass instantiation. This results in half the trees floating in the air since my terrain is so hilly.
Can anyone suggest a better way of doing this? I haven’t seen any examples of models with omni-directional billboards (where a 2-D picture of a tree is visible to the camera no matter the angle- a sort of “faux” 3D) surviving the GLTF conversion process without losing that as well as transparency (I haven’t gotten transparent textures to render transparently after being converted, even with the alpha-channel modifications that folks have suggested), otherwise I am sure that would be much less process intensive to do entirely client-side with simple models.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
An equivalent to this:
heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND
as well as ‘position’ would be an excellent add to Cesium.Cesium3DTileset options, but obviously this isn’t a trivial add.
4. The Cesium version you’re using, your operating system and browser.
1.7.1, Chrome 72