Sign in to follow this  
thrice

Using mesh instances with Babylon GUI

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?

Share this post


Link to post
Share on other sites

Ya I will when I have a chance: separately, I've been tracing down a pretty big bug in my local project with drawCalls multiplying on dispose for the past few nights. I think I figured out the cause, but can't reproduce on a PG, going to open bug on GH though.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.