Jump to content

[SOLVED]Is 'mesh.clone' better than 'new' or 'MeshBuilder.CreateXXX' ?


heyzxz
 Share

Recommended Posts

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 by heyzxz
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...