Batching draw calls of GO sprites with GO spine

I tried a few ways of adjusting materials to try and get sprite components to batch draw with Spine scenes but it seems like they are forced to draw on their own draw call batches?

It seems same issue is with GUI nodes.

Is there any hope when Spine is its own extension that sprites/Spine with same material could possibly be drawn together?

2 Likes

One of the things that will break batching of draw calls is component type:

2 Likes

I wonder if this is a hard constraint or something arbitrary? I don’t know how they work with rendering in the engine yet but would be interesting to learn / read the source.

It’s currently a hard constraint, since each component type have their own vertexbuffer/indexbuffer which is then submitted to the renderer.

2 Likes

I wanted to create similar topic, but found this.

In our project we faced with the big increasing of DrawCalls if use sortning Spine and Sprite GO’s

for example here with each added object and character add an addtional DrawCall:

Attached project for quick testing:
test.zip (24.0 KB)

does anyone know a possible solution for this case?

update:
tested in 1.4.0, I hoped that Added Create GO. Bones checkbox for SpineModel wil fix that, but nope.

We break batches on component type which will mean that if you interleave sprites and spine components you will get a lot of batches.

Have you tried using Spine also for the boxes and other static objects?

1 Like

it works as expected, thanks for the idea!

I’m wondering, for example, will 500 GO sprites on the screen and 500 GO spine have same performance on device?

No idea :slight_smile: You need to measure it. A spine component is “heavier” than a sprite, but I honestly don’t think it will have a huge impact. But that’s just a guess!

3 Likes

This has been my experience too. Basic Spine doesn’t add a lot compared to Sprite (and as it batches better it might actually improve your performance), the hits to performance usually comes from advanced features such as skinning.

2 Likes