Is batching not working when updating meshe's opacity?

Hi all,

Some of my characters have daggers (there is one type of dagger), and I’ve batched them. The issue is that when I update the opacity of a single dagger, my draw call increases. If I update each dagger individually, the draw calls increase one by one.

Steps I follow for a single dagger entity:

  • Disable the entity
  • Set the opacity of its mesh: render.meshInstances[0].setParameter(“material_opacity”, 0.1)
  • Enable the entity

I have to do this enable/disable entity process in order for the opacity change to take effect.

If you change parameters on mesh instances, they can no longer be batched with others as their rendering parameters are different.

1 Like

Thanks! Yeah, after posting this, I kinda guessed it. For this kind of thing, it’s better to have different material and replace the current one with it.

Yep, if you have multiple meshes of the same material, then probably yes.

1 Like