after going through many older topics covering this topic i’m able to successfully merge geometries. Mostly thanks to this fiddle by @Mugen87 Issue with merging objects by its geometries using mergeBufferGeometries() - #5 by Mugen87
Now, can i assign some value/group/attribute to each geometry so that when creating a mesh i can pass a material array ?
Even if its the same material , i could also use a color atlas image to put all the uv coords of each geometry on each color grid of the atlas
Reason for merging is when the mesh count goes above ~100 AR sessions and windows’s glb viewer starts to lag but after merging i can add a 1000 cubes without issue.
The fiddle (merging part the is last function)
Fiddle screenshot of three js handling 1000 cubes with MeshPhysicalMaterial like a champ