• Unity
  • Flipped images not showing bug?

In my character's setup in Spine Editor, I flipped (-1.0 X-Scale ) her right "eyelid closed" image to make the left one from the same image. Animations using this technique play fine in Spine editor, but in Unity runtime the right image shows, but the flipped left image doesn’t show whenever the character blinks. I also checked and confirmed this is happening with any image that is flipped in the same attachment slot, as I also do this for the hands.

This is annoying because I reuse the same image for the characters hands and feet and simply flip the appropriate ones for the other arm or leg. I thought this would allow me to avoid having the same image twice in the texture atlas.

This seems like a bug as it shows correctly in the editor but not runtime. Any suggestions besides doubling the amount of images in the texture atlas?

Related Discussions
...

This can happen if you are using a custom shader and that shader has backface culling turned on. If that's the case, you need to turn your shader's culling off.

However, this has lighting implications. But the Generate Normals checkbox on SkeletonAnimation fixes backface lighting problems. (or better yet forcing the shader to have all its vertex normals as a constant (0, 0, -1).

Thanks for the info. So does that mean using -1 scale rotates instead of scaling objects?

No, it's a triangle winding order thing.
Negative scale means the vertices are in spatially opposite positions, meaning the resulting triangles wind the opposite direction, causing engine (or the GPU?) to incorrectly deduce that the triangle is facing the opposite direction. The assumption is correct for 3D models with actual volume (where it makes sense not to draw the inner sides of meshes), not for 2D sprites. This is one reason why sprite shaders usually turn culling off.

Ah, makes sense, thanks!