I am working on a project where I need to render a fairly complex 3D scene with a lot of objects, textures, and lighting effects. While Babylon.js has been amazing so far, I’ve noticed a drop in performance when adding more assets to the scene. My frame rate starts to drop, especially on lower-end devices.
What are the best practices for optimizing performance in Babylon.js? Specifically, I am wondering about:
Efficient handling of large numbers of objects
Managing textures and reducing memory usage
Strategies for handling dynamic lighting/shadows without a huge performance hit
Any useful tips for optimizing the rendering pipeline in general
This is a clich é d issue, there is no universal best practice, and we can only find the bottleneck of scene rendering and optimize it ourselves. Usually, we start from these aspects: streamlining instances, freezing grids, shadow distance, camera distance, etc., in short, reducing drawCalls.
i understand you are new to this and looking for information but all the points you listed wanting help for cannot realistically be answered in one shot. These are all major topics on their own that will take some time of research and practice to get right. Start with the babylon documents. Then perhaps take one point at a time and start searching the forums and the internet. maybe you will find some condensed info on such matters , but even then it might be very project specific. So nothing you can copy and paste and problem solved etc…
I think best to start with getting BABYLON.inspector running, or instrumentation like this https://playground.babylonjs.com/#938RNX#29 (o7 whoever suggested/made it), and record your performance in the browser DevTools to find bottlenecks.
Otherwise probably people could comment on specifics if provided.