zzf

When I put many different Spine Anims In my Unity Project, there will be produce many DrawCalls, different materials will increase drawcalls;
how can i do to reduce it;
is there any way to do it?
zzf
  • Posts: 4

Harald

Unity's batching systems will reduce draw calls when the same texture is used across skeleton instances. So the number of batches can be reduced by not having a single atlas texture per skeleton, but packing attachment images of multiple skeletons to a single shared atlas. You would typically do this by packing the atlas via the command line interface instead of alongside each skeleton export.

Texture packing - Spine User Guide: Folder structure
Command line interface - Spine User Guide

Note that the command line interface allows you to specify a Spine project for handling Mesh Attachments in a more efficient way: --project <Path> "Path to a project to determine which images are used by meshes.."

This is under the assumption that you are not seeing multiple batches for a single skeleton instance (e.g. due to multiple blend modes or multiple atlas textures for a single skeleton). If this is the case, then optimizing the draw order or grouping of attachment images to atlas pages could help. If you see multiple draw calls (multiple materials at a single skeleton GameObject in the Inspector), please have a look at the following spine-unity documentation section:
spine-unity Runtime Documentation: Material Switching and Draw Calls
User avatar
Harald

Harri
  • Posts: 4164

zzf

Thanks a slot
zzf
  • Posts: 4


Return to Unity