When drawing a large number of objects in a GUI.Container and performing container movement, the performance becomes very sluggish

Please keep in mind that GUI utilizes a 2D Canvas CanvasRenderingContext2D - Web APIs | MDN (mozilla.org) which can really struggle with drawing lots of elements. In a scenario like this, I highly recommend using 3D planes and textures/shaders instead, as they can take advantage of instancing ( Instances | Babylon.js Documentation (babylonjs.com)) to achieve much better performance.

You can see an example of such here, where I compare the use of GUI vs the use of a Node Material Shader for dynamically updating billboards: Counters with GUI and billboard instances | Babylon.js Playground (babylonjs.com). The approach with GUI hovers over 40 FPS, and increasing the number of objects will quickly make it run out of memory, while the shader approach achieves a solid 60FPS.

1 Like