• Runtimes
  • Mesh or no mesh, performance gains?

Is it better to convert a png with transparency to a mesh, say a leg or arm and mesh it tightly around it's shape (the image will not be deformed by a bone). I presume this will save on fill rate. Will this save on performance over just leaving it as a png. If I understand correctly, all images are put on a quad meshes any way, so putting in some extra vertices to shave away the transparency, would that save me perf or would the extra vertices make it worse?

BTW we are doing web based mobile games with Pixi. I'm just an artist so I can't easily make a perf test my self.

Related Discussions
...
  • 編集済み

A region attachment is 4 vertex transforms, which use CPU. A mesh is 3 or more, so is only more efficient CPU-wise at 3 vertices, the same at 4, and less above 4.

All pixels affect fill rate, even transparent pixels. Using a mesh to avoid drawing pixels saves fill rate, but likely uses more CPU.

For most devices, you are more likely to run into a CPU bottleneck than fill rate. If your app is not limited by fill rate or CPU, then any time spent optimizing those things was time wasted. If you do have fill rate problems, it's easy to go back and change a region into a mesh to add vertices, so I suggest using region attachments to start.