Pancho ha scrittoOk, but why mesh models have so low performance?
I repeat my question 2 months ago:
viewtopic.php?p=13946#p13946
"I noticed that skeleton with meshes generates quite a lot draw calls (1 draw call per attachment, it doesn't matter that all images are in one atlas). An implementation uses PolygonBatch class, but I don't see too much profit from this way (a similar name to QuadBatch suggests that it will be fast, but it isn't). Any chance for more effecient solution? For example, 1 draw call per atlas, like in version without meshes?"
I noticed such low performance when rendering skinned meshes with the starling Skeleton from the Spine starling runtime as well. Looking into the issue I was able to get draw calls from 31+ to just 1.
Changed line 176 of SkeletonSprite.as from:
polygonBatch.add(image.texture, worldVertices, verticesLength, uvs, triangles, r, g, b, a, slot.data.additiveBlending, matrix);
to
polygonBatch.add(image.texture.root, worldVertices, verticesLength, uvs, triangles, r, g, b, a, slot.data.additiveBlending, matrix);
When pass sub textures from an atlas like the Spine Starling SkeletonSprite.as class does, the Polygon Batch flushes (uploading to GPU) for each image body part of the character, which is not ideal and results in a separate draw call for each texture/body part. This is because textures derived from an atlas main texture is a SubTexture that simply refers to the root Concrete texture that is the whole sprite sheet. The purpose of using a sprite sheet and batching is to have one draw call and better performance. So by passing the root (Concrete Texture) instead of the SubTexture the texture being passed to the PolygonBatch class never changes and stopped flushing in the middle of batch render calls.
@Nate hopefully this can be added to the official Starling Spine runtime...
