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.
Spine Edge Distorted!! Help Me!!
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.
Misaki Hello, I resolved the issue by enabling the 'atlas per skeleton' option during export. This exports each Spine animation in the scene as a separate atlas with a dedicated material. Could you clarify how to choose between this option and 'Single atlas'? The official documentation doesn't explain these settings.
FattyJoker In my previous reply, I mentioned that no artifacts appeared when exporting and importing only the relevant skeleton. This is effectively the same result as when the "Atlas per skeleton" option is selected. However, based on your earlier message, I understand that your goal is to combine the textures of multiple skeletons into a single atlas, so using "Atlas per skeleton" may not be the desired solution in your case.
The difference between "Single atlas" and "Atlas per skeleton" is described in the user guide: https://esotericsoftware.com/spine-texture-packer#Packing-during-data-export
If multiple skeletons are expected to appear in the same scene, combining their textures into a single atlas can reduce the number of materials and thus reduce draw calls. On the other hand, if the skeletons are unlikely to appear together, it's better to pack them separately to avoid loading unnecessarily large textures, which can affect performance.
We are continuing to investigate the root cause of the artifact, so please bear with us while we look into it.
@FattyJoker We have just pushed a shader bugfix for this issue to the 4.2 and 4.3-beta branches.
Details: The SkeletonGraphic shaders used half2
for texcoords, which depends on the target platform and target shader model whether it ends up as a 32bit or 16bit float. For 4k atlas textures actual half (16bit) precision leads to quantization artifacts seen in your screenshots.
New spine-unity 4.2 and 4.3-beta unitypackages are available on the download page as usual:
https://esotericsoftware.com/spine-unity-download
Please do let us know whether this resolves the issues on your end as well. Thanks for reporting!
The issue has been tracked under this issue ticket:
EsotericSoftware/spine-runtimes2892
@FattyJoker Very glad to hear it helped, thanks for your kind words!