• Unity
  • Using Spine Animation with single image vs. Unity "Sprite"

I need to render both Spine Animations (with lots of images/moving parts/etc), and I also have static images.

This is for a top-down 2D game where everything is sorted along the y-axis (like SNES legend of zelda). Lets say I need to render 40 Spine Animations and 200 static images. I'm trying to figure out which would be more efficient:

Case 1: Make the static images as Unity "Sprites". This means every time the rendering switches from a Spine Animation (note: the spine animations will all share a single texture atlas) to a Sprite, it starts a new batch. And vice-versa when going from a Sprite to a Spine Animation.

Case 2: Make the static images as Spine Animations that simply don't move. AKA just a root bone and the single image. Now there won't be lots of batches, but would there be a lot of overhead in rendering a Spine Animation (even with only a single image) versus a simple Unity Sprite?

Thanks!

Related Discussions
...

There should not be a lot of overhead for rendering as a minimalistic Spine skeleton compared to a Unity Sprite. Mesh generation of a simply skeleton will not take a lot of time, and after generating the mesh, it will be rendered just as a normal MeshRenderer's mesh, applying batching, etc.

Nevertheless, we would recommend to try this out once with one of your static assets, placing it 200 times in your scene as a skeleton, then switching to a version of the scene with Unity's Sprite in use. You can then precisely measure the actual overhead that it will cause on your target device.

Also be sure to export your skeleton assets in binary format (and not as JSON), so that loading time and memory allocation is minimized.

Harald escreveu

There should not be a lot of overhead for rendering as a minimalistic Spine skeleton compared to a Unity Sprite. Mesh generation of a simply skeleton will not take a lot of time, and after generating the mesh, it will be rendered just as a normal MeshRenderer's mesh, applying batching, etc.

Nevertheless, we would recommend to try this out once with one of your static assets, placing it 200 times in your scene as a skeleton, then switching to a version of the scene with Unity's Sprite in use. You can then precisely measure the actual overhead that it will cause on your target device.

Also be sure to export your skeleton assets in binary format (and not as JSON), so that loading time and memory allocation is minimized.

Thanks Harald, I'll give that a try! Also yeah, need to switch over to binary... thanks for the tip!

You're welcome.

Since you are a capable programmer, maybe the Spine command line interface is of interest to you to automate export of skeleton data and atlas textures:

If you have many projects, we suggest automating exporting your project files:
Export - Spine User Guide: Command line
For example, here is a script we use to export all the Spine example projects and to create texture atlases:
spine-runtimes/export.sh at 3.8

Harald escreveu

You're welcome.

Since you are a capable programmer, maybe the Spine command line interface is of interest to you to automate export of skeleton data and atlas textures:

If you have many projects, we suggest automating exporting your project files:
Export - Spine User Guide: Command line
For example, here is a script we use to export all the Spine example projects and to create texture atlases:
spine-runtimes/export.sh at 3.8

Oh man, I am DEFINITELY checking that out.

Workflow improved by +20% 8)

😃 Glad to hear! :nerd: