Optimize performance with multi-layer support
masterCreating many individual 3D layers in Mapbox is resource-intensive because each layer is rendered separately. To optimize performance, use the multiLayer parameter.
When multiLayer is enabled, Threebox creates an embedded internal layer that manages rendering with a single call to tb.update. This ensures the Mapbox render loop only calls the Three.js render once, significantly saving resources.
You can also manage visibility for these layers using tb.setLayoutZoomRange to hide/show layers based on the current zoom level.