• Runtimes
  • Do You Recommend Using Spine for UI and Backgrounds?

Hello,

I am a game developer. I have discovered that using Spine for UI and backgrounds encourages artists to enthusiastically participate in improving quality. However, doing so results in a significant number of slots, which I expect will impact optimization.

I anticipate having around 200 slots per background scene.

The expected issues are an increase in draw calls and memory usage.

Do you have any recommended approaches or is this not advisable?

Thank you.

Related Discussions
...

Using Spine for UI and backgrounds can indeed be beneficial, especially for creating rich, animated interfaces that engage artists. However, as you mentioned, having a significant number of slots can impact optimization, particularly in terms of draw calls and memory usage.

Here are some recommendations to mitigate these issues:

  1. Texture Atlases: Combine multiple images into a single texture atlas. This reduces the number of draw calls by ensuring that multiple slots can be rendered in a single draw call. You can use the Spine Texture Packer to create these atlases.

  2. Runtime Repacking: For dynamic content, consider repacking atlases at runtime. This allows you to combine only the images currently needed, reducing memory usage and draw calls. The spine-unity runtime provides examples like "Mix and Match" that demonstrate how to do this.

  3. Efficient Use of Slots: Minimize the number of slots by reusing them where possible. For instance, if multiple elements share the same animation or visual properties, they can be combined into a single slot.

  4. Batching: Ensure that your images are packed into a single atlas page to enable dynamic batching. This can significantly reduce draw calls if the general batching requirements are met (e.g., vertex count).

  5. Performance Testing: Always test on your target devices to ensure that performance is acceptable. This is crucial as different devices may handle the load differently.

  6. Skeleton Draw Order: Manage the draw order of skeletons to optimize rendering. This can be done by controlling which skeletons are drawn on top of others.

For more detailed information, you can refer to the following resources:

By following these practices, you can leverage Spine's capabilities for UI and backgrounds while maintaining optimal performance.


Here is image.
Currently, it doesn't include any bones and uses only slots.

  • Misaki ответили на это сообщение.

    oz99 It is difficult to advise on performance issues based on this information alone, but in general, 200 slots on a single skeleton is quite common. Whether this is a problem for drawing performance depends less on the number of slots and more on the resolution of the image and whether its textures will fit on a single texture atlas page. In this sense, Spinebot's answer "having a significant number of slots can affect optimization" is a bit inaccurate, but I think the solutions Spinebot suggested should actually be helpful to you.

    You can find a summary of which elements of the skeleton may affect performance and how on the "Metrics view" page of the Spine User Guide: https://esotericsoftware.com/spine-metrics

    • oz99 ответили на это сообщение.
    • oz99 оценил это.

      Misaki
      Thank you for your reply. Your answer will be very helpful.😊