• Editor
  • Cutting Images in Spine's Edit Mesh vs. Photoshop: Performance Considerations

Hi everyone!

I have a small question regarding performance. Previously, I used Photoshop to divide images (such as different parts of clothing) before uploading them to Spine. However, sometimes I need to further divide an already segmented part to achieve better perspective effects. To maintain the previous vertices and weights, I would directly copy a new slot and mesh in Spine, then use the Mesh Editor to cut the same image into two halves, keeping the left side and the right side separately. This approach seems to significantly improve efficiency so far.

But I'm concerned about the impact on performance. These adjustments made directly in the setup don't seem to belong to deformed vertices, but it appears that the same image is loaded twice. Is this less performance-friendly compared to dividing the clothing into two parts in Photoshop?

If the performance difference is minimal, I'm considering uploading larger images and then copying and cutting them into smaller meshes in Spine. This method seems easier for monitoring the occlusion relationships of various parts in different animations and cutting them into more reasonable sizes. It could also potentially reduce unnecessary bones, weights, and vertices to some extent.

Thank you very much for your guidance!

    Related Discussions
    ...

    When considering performance, there are a few key points to keep in mind regarding cutting images in Spine's Edit Mesh versus Photoshop:

    1. Image Loading and Texture Atlas: If you cut images directly in Spine, the same image will be loaded multiple times, which can increase the memory usage since each mesh will reference the same texture. However, if you divide the images in Photoshop before importing them into Spine, you can optimize the texture atlas better, potentially reducing the overall texture size and memory usage.

    2. Vertices and Weights: Using Spine's Mesh Editor to cut images can help maintain the previous vertices and weights, which is beneficial for animation consistency. However, this approach might lead to more complex meshes with additional vertices, which can impact performance, especially if the meshes have many vertices and are used with clipping attachments.

    3. Performance Impact: The performance difference between the two methods can be minimal if managed properly. For instance, using fewer vertices and avoiding excessive deform keys can help maintain good performance. Additionally, reducing the number of vertices in the clipping attachment and the total number of vertices in all clipped regions can minimize CPU usage.

    4. Workflow Efficiency: Cutting images in Spine can be more efficient for monitoring occlusion relationships and making adjustments during the animation process. This method allows for more flexibility and can reduce the need for unnecessary bones, weights, and vertices.

    In summary, while cutting images in Photoshop can lead to better texture atlas optimization and potentially lower memory usage, cutting images in Spine can offer greater flexibility and efficiency in the animation workflow. The performance impact can be minimal if you manage vertices and weights properly and avoid excessive deform keys.

    For more detailed information on performance considerations, you can refer to the Spine Clipping Performance Guide and the Spine Meshes Guide.

    wpw1221 These adjustments made directly in the setup don't seem to belong to deformed vertices

    What do you mean by "belong to deformed vertices"?

    wpw1221 but it appears that the same image is loaded twice.

    Do you mean that you are re-using a single larger attachment image on two meshes, each mesh using half of it? Nothing will be loaded twice then at runtime, all attachments are baked into an atlas and then the respective texture regions will be mapped to your geometry.

      Harald

      What do you mean by "belong to deformed vertices"?

      Thank you, Harald. Initially, I thought adjusting vertices to make the image different from the atlas would lead to deformed vertices and affect performance. Later, I realized that only making these adjustments in animation impacts the number of deformed vertices. So, adjusting vertices in the setup to deform the image or display only a part of it should not negatively impact performance, right?

      Do you mean that you are re-using a single larger attachment image on two meshes, each mesh using half of it?

      You understood correctly! So, combining your suggestions and the bot's advice, if I divide the images in Spine instead of Photoshop, it has almost no negative impact on performance and only brings advantages. Is my understanding correct? 😃

        wpw1221 So, adjusting vertices in the setup to deform the image or display only a part of it should not negatively impact performance, right?

        Thanks for the additional info. Exaclty, such deformation during setup time is free. The mesh vertices will just have different positions and UV coords. What is expensive and should be avoided is possible is using deform keys in an animation to move your vertices around.

          Harald That's convenient, thank you Harald! 😃

          @wpw1221 You're welcome, glad it helped. 🙂