Jump to content

Using mesh instances with Babylon GUI


thrice
 Share

Recommended Posts

I am trying to make my scene (card game) as performant as possible. I've made it quite a bit faster by using mesh instances and sharing them with cards and what not, but it seems like I am unable to use instances with a mesh which has a AdvancedDynamicTexture material/texture on it. Primary use case is each card has it's own separate attribute set, however the attributes appear all in the same location on the mesh. (i.e., card name, type, attack, health, cost, etc)

I think it's actually just one draw call for the plane and an additional one for the texture, but still would be nice if it were possible.

Am I missing something or is this currently not supported?

Link to comment
Share on other sites

A BABYLON.InstancedMesh must have a BABYLON.Mesh associated with it.  The BABYLON.Mesh.material is used for it as well as all it's  InstancedMeshes.  Having a unique material for a InstancedMesh is never going to happen.  This is nothing to do with an AdvancedTexture.

I would say you might save GPU memory using clones, but hardly worth it for basically a plane.

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...