thrice Posted July 30, 2017 Share Posted July 30, 2017 So I've been trying to improve performance in my scene. Been stuck at around 40fps consistently. I am making a card game, so there are a lot of planes, with a lot of materials (the images for the cards), as well as each card in hand / on board having its own set of attributes. Anyways, I was under the impression that scene.engine.drawCalls, was the number of things babylon would redraw, or check to see if it was dirty or whatever, everytime the render loop runs. Now I'm not so sure, because after reducing my draw calls from a minimum 350 when I load my scene, to 200, I haven't really seen a FPS boost. Before I continue to refactor to reduce the number of draw calls, I figured I would ask, am I missing something here? Or is that still a large number of draw calls, which could be causing or contributing to the low FPS? Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted July 30, 2017 Share Posted July 30, 2017 Hi @thrice Drawcalls have a big impact, especially if you're also targeting mobile / tablet / low-end laptops etc Texture wise, it would be optimal to only have one, e.g a spritesheet/texture atlas to really knock away some drawcalls. Geometry wise, using fewer and simpler models and instancing >(or) cloning where possible. Quote Link to comment Share on other sites More sharing options...
Convergence Posted July 31, 2017 Share Posted July 31, 2017 Each material per mesh(or instance thereof) is basically one draw call. Seconding @aWeirdo, having all cards of the same suit in one large texture would likely reduce draw calls by a lot. If you do this, you'll probably want to use SPS to get the draw call reduction benefit. I assume many cards will only be visible from the back, so they can all be collapsed onto one draw call. Quote Link to comment Share on other sites More sharing options...
thrice Posted July 31, 2017 Author Share Posted July 31, 2017 On 7/30/2017 at 5:33 PM, aWeirdo said: Geometry wise, using fewer and simpler models and instancing >(or) cloning where possible. Thanks for the tips. I think the initial not seeing FPS improvement was also due to electron, which behaves really strange w babylon sometimes (like sometimes when scene is loading, fps will just tank to like 30 and never recover, until I minimize window and bring it back to the foreground). Anyways I'm down to 150ish draw calls now and seeing 50+ FPS for the first time in quite awhile! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.