EDIT : Quite sure each slot += draw call π’
I have a single character rendered via the Starling framework.
Yet I have 30 draw calls for a single character even though the texture is packed into an atlas...
No state changes that I am aware of (such as alpha), smoothing set to "none" even set blend mode to "none"
as well, finally no meshes.
Running in release with all the debug code disabled π
On the Nexus10 two characters can reduce the fps from 60 to under 30.
Any ideas?
I have 30 slots in the animation, and it uses 30 draw calls. So my guess is that it is drawing
each slot with a different batch or something?
P.S : I ran Adobe Scout profiler, it looks like the problem is to do with uploading data
to the GPU. But I am using the latest version of Starling, and the draw calls seem way too high.
Also, I am using an xml version of the Texture-Packer and using the StarlingAtlasAttachmentLoader with it.
The FPS overlay that comes with starling, certainly does not rack up the draw call amount π
(I was expecting 1 draw call, even on both characters as they share the same atlas, same spine export etc)
I set a breakpoint in "SkeletonSprite::renderMeshes":
private function renderMeshes (support:RenderSupport, alpha:Number) : void {
if (!batchable) {
_polygonBatch.begin(support, alpha, blendMode);
addToBatch(_polygonBatch, support, alpha, null);
_polygonBatch.end();
} else if (!_batched) {
[u][b] support.popMatrix();[/b][/u]
_polygonBatch.begin(support, alpha, blendMode);
addToBatch(_polygonBatch, support, alpha, transformationMatrix);
for(var i:int = parent.getChildIndex(this) + 1, n:int = parent.numChildren; i < n; ++i) {
var skeletonSprite:SkeletonSprite = parent.getChildAt(i) as SkeletonSprite;
if (!skeletonSprite || !skeletonSprite.batchable || skeletonSprite.blendMode != blendMode) break;
skeletonSprite._batched = true;
skeletonSprite.addToBatch(_polygonBatch, support, alpha, skeletonSprite.transformationMatrix);
}
_polygonBatch.end();
support.pushMatrix();
support.transformMatrix(this);
} else
_batched = false;
}
And found that in some-way, batching is disabled.
Could that be responsible for the high draw count?! And if so, how do I solve it.