Hi everyone, I'm having some issues using Spine. After importing Spine assets into Unity, I noticed that the edges of the animation become distorted during runtime. I've tried many solutions found online, but none have resolved the problem. Can anyone help me? The screenshot below shows an example of the distortion.
Spine Edge Distorted!! Help Me!!
FattyJoker Unfortunately, it is difficult to determine the cause based on this information alone. Please check the following:
Select the SkeletonDataAsset
for that skeleton and check whether the skeleton is displayed correctly in the Preview
section at the bottom of the Inspector window. If it appears correctly in the Preview, the issue may be related to your implementation.
In that case, please send us a minimal Unity project that reproduces the issue via email at contact@esotericsoftware.com.
Please include the URL of this forum thread in the email so we know the context. Then we can take a look at what's wrong.
If the skeleton does not display correctly even in the Preview, the settings for exporting from Spine may not be appropriate. Please show us the settings in the export window and the texture packer settings window.
Misaki
Yes, the issue is already visible in preview. My project uses linear color space, so I'm not using Premultiplied Alpha (PMA). Here are the Spine export settings:
Here are the screenshots of the texture settings in Unity.
My Unity version is 2021.3.41f.
Spine version is 4.2.18
FattyJoker What exactly do you mean by "distorted", do you mean the mesh edges should be straight downward? Could you show a second image of the expected result, e.g. how it is supposed to look, e.g. in the Spine Editor. Please note that we don't know your project.
Are you using Physics Constraints at your flag?
Regarding your export and import settings: did you also enable Straight alpha texture
at the Material?
My Unity version is 2021.3.41f.
Spine version is 4.2.18
What exact version of the spine-unity runtime (name of the unitypackage, also listed in Assets/Spine/version.txt
, or in the Package Manager) are you usiung?
FattyJoker The settings you showed us appear to be normal, so it might be best to send us the Spine project file so we can confirm what the expected results should be. Could you please include the link to this thread in the body of your email and attach the relevant Spine project file?: contact@esotericsoftware.com
Harald
The intended effect in Spine is shown below - this is precisely what I expect:
Additionally, this animation segment doesn't utilize any physics effects.
Misaki
Additional context: In the Unity Editor, the animation renders correctly during preview on Windows/Mac platforms. However, when switching to iOS or Android build targets, the distortion issue described above occurs.
FattyJoker I see. Based on that information, it may be a quality setting issue. When building for iOS or Android in Unity, the quality settings may be adjusted to match the target platform, which could lower the anti-aliasing level or change settings such as anisotropic textures, thereby altering how the edges appear. Could you please review them and see if the problem is resolved?
Misaki
The project uses URP. Below is a preview on the Mac platform, where the animation renders correctly. However, I'm particularly confused because the Quality Settings configurations for all three platforms (Mac/iOS/Android) are identical...
Misaki
Our art team designs on Windows PCs, and we've confirmed this edge warping issue doesn't occur when targeting the iOS platform in the same Unity version. However, when running on Mac PCs, we're observing significant edge distortion. Could this be caused by differences in the underlying rendering API? I've exhausted other troubleshooting approaches without success...
@FattyJoker I'm not sure I understand exactly where you are encountering the above issue. Do you mean that the SkeletonAnimation preview shows a correct result at the following combination:
- Editor runnining on MAC, Active Target iOS - distortion visible in the Unity Editor.
- Editor runnining on Windows PC, Active Target iOS - correct display in the Unity Editor.
To be more precise: in the distorted case, where exactly do you see the distortion: In the Scene view, in the Game view, in the Preview panel?
My guess its that the machines where the issue is visible are either a) rendering at higher resolution and thus sampling artifacts occur, or b) thetextures are resized differently on the problematic platforms.
Also ensure that Game view is set to 1x zoom and not something like 1.5x.
Harald
Yes, your summary is correct. Let me add these observations:
On Windows PCs, all three platform previews (Mac/iOS/Android) in Unity display the animation correctly.
On Mac PCs, only the Mac platform preview works correctly in Unity - both iOS and Android previews show incorrect rendering.
I can consistently reproduce the distorted animation in both Game View and Scene View, which is utterly perplexing..
My Game view is set to 1x zoom.
FattyJoker It is difficult for us to identify the cause based on speculation alone, so we would appreciate it if you could create a minimal Unity project that reproduces the problem and send it to us via email: contact@esotericsoftware.com
Please include the URL of this forum thread in the email so we know the context. Then we can take a look at what's wrong.
Misaki
I had sent emai with spine asset.
FattyJoker Thank you for sending us an email. I checked our inbox, but it seems that we have not received your email yet. Just to be sure, did you send it today?
Misaki I sent it again..
FattyJoker Thank you for resending it! We received your email.
However, what you sent us was a Spine project file, not a Unity project file, and the contents were not minimal at all.
Even so, I exported the Spine project you sent me, imported it into a new URP project, set the build target to iOS, and checked the animation, but I couldn't reproduce the problem. (I am using a Mac PC.)
I sent you a video of the test results as evidence via email. Please check it.
Please review your settings again based on these results or send us a minimal Unity project that reproduces the problem: contact@esotericsoftware.com
Misaki
Opps...
this spine animation is SkeletonGraphic (UI), i forgot to say.
OK, I sent a minimal Unity project and my viedo.
THX!!
FattyJoker Thank you for sending us the video and Unity project.
After reviewing them, we have confirmed that the issue occurs only when using SkeletonGraphic.
However, when testing a different Spine skeleton under similar conditions, we were unable to reproduce the same problem.
I also noticed that your skeleton shares textures with many others, resulting in a large combined texture size.
So, I tried exporting and importing only the relevant skeleton, and the edge distortion problem did not occur.
We will continue to investigate this matter further.
Misaki You're absolutely right. I tested importing only relevant Spine asset, replaced the corresponding texture files and material files, and the edge distortion problem did not occur!
However, our project requires dozens of these Spine assets per scene. This is precisely why we need to merge and export the required textures into a single large atlas. Currently, we're using 4096x4096 atlases which fall within our project's performance budget. Looking forward to your insights, and I'll continue troubleshooting to identify the root cause.