MrPage Posted April 4, 2018 Share Posted April 4, 2018 Hello. Recently I've decided to move my project from Unity to Babylon, but I met several problems, one of which - mesh batching. Unity have feature called "dynamic batching", which can greatly reduce draw calls. It's automatically merge all meshes with the same material into one, and draw it in single DC (with some nuances). Does Babylon have some similar abilities? Thanks, and sorry for my English Quote Link to comment Share on other sites More sharing options...
Hersir Posted April 4, 2018 Share Posted April 4, 2018 Check create instance in docks should do what you want, it reuses geometry and material (you can still change position/scale/rotation) Quote Link to comment Share on other sites More sharing options...
MrPage Posted April 4, 2018 Author Share Posted April 4, 2018 Hello. Thanks for your suggestion. But when I create for example, 10 meshes and 10 instances for each it still draw each base mesh in particular draw call, although this base meshes share the same material. Quote Link to comment Share on other sites More sharing options...
Hersir Posted April 4, 2018 Share Posted April 4, 2018 Yes real meshes don't have any share out of box, only clones and instances. Quote Link to comment Share on other sites More sharing options...
JohnK Posted April 4, 2018 Share Posted April 4, 2018 @MrPage hi and welcome to the forum. Babylon.js has several methods to achieve what you want and more. Merge Meshes meshes must have same material https://www.babylonjs-playground.com/#J5ACF1 Instances meshes must have same material https://www.babylonjs-playground.com/#J5ACF1#1 Cloned meshes can have different materials but share geometry https://www.babylonjs-playground.com/#J5ACF1#2 Solid Particle System a single mesh formed from one base mesh repeated many times with shared material (but different colors) https://www.babylonjs-playground.com/#WCDZS#7 and now a single mesh formed from two different meshes repeated many times with shared material (but different colors) https://www.babylonjs-playground.com/#WCDZS#2 jerome 1 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.