# How can I optimize meshes for over 20,000 cubes?

**URL:** <https://forum.babylonjs.com/t/how-can-i-optimize-meshes-for-over-20-000-cubes/16945>\
**Category:** Questions\
**Tags:** material\
**Created:** [December 26, 2020, 6:22am UTC](https://forum.babylonjs.com/t/how-can-i-optimize-meshes-for-over-20-000-cubes/16945 "2020-12-26T06:22:52Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [December 26, 2020, 3:45pm UTC](https://forum.babylonjs.com/t/how-can-i-optimize-meshes-for-over-20-000-cubes/16945/7 "2020-12-26T15:45:15Z")

</div>

The simplest example is here - [https://playground.babylonjs.com/#3A2PUF#2](https://playground.babylonjs.com/#3A2PUF#2)  
It renders the scene only when pointerDown.  
Another example with RollingAverage - [Babylon.js Playground](https://playground.babylonjs.com/#9W2NDV)  
But without knowing your specific application it is difficult to give you the exact answer.  
This subject has a lot of discussions, so I would suggest you to search first; and, then, to find the best method for your case.  
Here just a couple of links - there are dozens of them:  
[What's the difference between engine.getDeltaTime and scene.getAnimationRatio? - Questions - Babylon.js](https://forum.babylonjs.com/t/whats-the-difference-between-engine-getdeltatime-and-scene-getanimationratio/61)  
[Decoupling Frame rate from movement speed issues - Questions - Babylon.js](https://forum.babylonjs.com/t/decoupling-frame-rate-from-movement-speed-issues/9611)  
[Which Best Method for Mesh Rendering (Updated Every Frame) - Questions - Babylon.js](https://forum.babylonjs.com/t/which-best-method-for-mesh-rendering-updated-every-frame/2834)  
From old Forum - [Controlling the render loop - Questions & Answers - HTML5 Game Devs Forum](https://www.html5gamedevs.com/topic/18215-controlling-the-render-loop/)

---

_[View the full topic](https://forum.babylonjs.com/t/how-can-i-optimize-meshes-for-over-20-000-cubes/16945)._
