heyzxz Posted March 23, 2017 Share Posted March 23, 2017 (edited) Hi guys, From the performance perspective, I used to think that 'clone' a mesh is totally the same as creating a new one with 'new' or 'MeshBuilder.CreateXXX' ,until I saw this article: https://blog.raananweber.com/2015/09/03/scene-optimization-in-babylon-js/ Well, comparing the three: Mesh.createInstance, Mesh.clone, MeshBuilder.CreateXXX (or 'new'): First, It's no doubt that the 'createInstance' has the best performance, what I care about is does 'Mesh.clone' have better performance than MeshBuilder.CreateXXX (or 'new')? To make my question more 'straightforward', can someone please let me know the right or wrong for the below descriptions: CODE1: sphere1 = MeshBuilder.createXXX(); sphere2 = MeshBuilder.createXXX(); CODE2: sphere1 = MeshBuilder.createXXX(); sphere2 = sphere1.clone('a name'); Descriptions (right or wrong?): #1. CODE1 and CODE2 should have the same draw calls 2, because only 'createInstance' can make the draw calls to 1. #2. CODE2 has less GPU memory usage than CODE1, since they are sharing the same buffer. #3. CODE2 takes slightly less render time, since it has less 'bindBuffer' called each frame. Thank you! Edited March 23, 2017 by heyzxz Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 23, 2017 Share Posted March 23, 2017 hello! #1 Correct #2 Correct #3 Correct It is a perfect Quote Link to comment Share on other sites More sharing options...
heyzxz Posted March 23, 2017 Author Share Posted March 23, 2017 Thanks for you answers! GameMonetize 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.