All it’s leaves are the same triangle, with varying rotation and scale. Currently I got them merged for export, and they are only 300 tris so it’s not too bad. However it might be troublesome if I had hundreds or even thousands of those trees with 300 leaves each. That’s why I’d like to optimize it further and make them (the leaves) an InstancedBufferGeometry mesh. As far as I know, its not possible to export that to GLTF (with blender at least), so they would probably need to be constructed during the loading phase in the app.
Most primitive way of acchieving that would probably be to export them as single objects, loop through each of them and copy each of their offset, rotation and scale to a new InstancedBufferGeometry, making a new better mesh. All that sounds extremely sketchy to me though and I suspect there should be a better way.
Is there some recommended workflow for this?
Thanks in advance
This is basically the way you do it, though you will have to disable culling (frustumCulled to false on the mesh) then since instanced geometries aren’t culled anymore. To save memory you could place null-objects in blender as placeholder and give them a name for when you traverse through the scene on the import.
If you’re interested, im very soon releasing a IndexedScene with auto-instancing that also keeps culling, you find some information here. It helps to render very large and rich scenes you couldn’t render with a regular scene.