I create my artwork in Clip Studio and export it as PSD files to animate in Spine. Recently, I completed one animation and successfully imported it into Unity. However, when I zoom in and out with the camera, the resolution becomes noticeably low compared to the original artwork. I've been trying to resolve this issue for the past five days without success, so I’m reaching out for help. I would really appreciate any support you can provide.
clipstudio to psd and unity error
It sounds like you are experiencing a resolution issue when importing your artwork from Clip Studio to Unity via Spine. This is a common problem that can occur due to mismatched export settings between Spine and Unity. Here are a few steps you can take to troubleshoot and potentially resolve the issue:
Check Export Settings in Spine: Ensure that your export settings in Spine are set to a scale of 1.0 to maintain the original resolution of your artwork. You can refer to the Spine Texture Packer settings to verify that your images are being packed correctly.
Preview in Spine: Before importing into Unity, use the Preview section in Spine to check if the skeleton and images appear at the correct resolution. You can adjust the zoom level in the Preview section to ensure everything looks as expected.
Unity Import Settings: When importing into Unity, make sure that the import settings for your textures are not automatically reducing the quality. Check the texture import settings in Unity to ensure they are set to the appropriate resolution and compression settings.
Match Project Settings: Ensure that the project settings in Unity match the export settings from Spine. This includes checking the color space settings (e.g., Linear vs. sRGB) and ensuring that the pixel per unit settings are appropriate for your artwork.
If these steps do not resolve the issue, consider providing screenshots of your export settings in Spine and the import settings in Unity. This can help identify any discrepancies that might be causing the resolution problem.
loi I think it is probably a problem with the mipmap textures, as the resolution varies depending on the zoom level of the camera. If you are not familiar with mipmaps themselves, take a look at the mipmaps introduction page in the Unity manual:
https://docs.unity3d.com/2021.3/Documentation/Manual/texture-mipmaps-introduction.html
We have discussed in the past in the following thread how to assign a higher resolution mipmap image, so if you want to do that, it would be helpful:
https://esotericsoftware.com/forum/d/18075-using-your-own-mipmaps-with-spine
loi Unfortunately it is difficult to determine the cause from the screenshot alone, so could you send us via email a minimal Unity project that can reproduce the problem?: 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.
loi now when I zoom out, lines that weren't originally present start to appear. I followed the tutorial using GIMP,
Which tutorial do you mean? Do you mean you've created mipmaps in Gimp? Are you sure you want to set mipmap levels manually? Unless you have a good reason for it, it's much easier to either disable mipmaps if you want none, or enable mipmaps and set a mip-map bias as mentioned here.
If you have to use manual mipmaps, please describe in detail:
- How you have exported your atlas textures (export settings, whether you're using PMA or straight alpha workflow),
- What you texture import settings in Unity are. Also try to disable any compression settings if enabled.
- How you're assigning mipmap levels in code.
Harald The tutorial I was referring to is the "spine-unity import trouble" guide. When unwanted lines appeared, I followed the suggestion to use GIMP to preserve color values in transparent pixels.
I disabled premultiplied alpha, set the minimum and maximum atlas size to 2048x1024, and used a padding value of 4. All other settings were left as default.
My texture import settings in Unity are shown in the screenshot I provided.
Also, the issue wasn’t resolved by manually changing mipmaps through code — it was resolved simply by enabling mipmaps.
When mipmaps are disabled, the image appears broken or jagged when zoomed out, but when they’re enabled, strange lines appear in the artwork.
loi The tutorial I was referring to is the "spine-unity import trouble" guide
I assume you mean the "[spine-unity] Import Troubleshooting" video here:
In general it's best to share a link, then there is no ambiguity left.
loi I disabled premultiplied alpha, set the minimum and maximum atlas size to 2048x1024, and used a padding value of 4. All other settings were left as default.
A padding of 4 might be causing your neighbour attachments in the atlas to blur over if you display a high mipmap level. Note that when displaying the first mip level, 2 texels are blurred together, on the next level 4, then 8.
Please have a try whether increasing the padding to 8 during atlas packing changes the situation, it should then show the stripes on the next zoom-out mip-map level. If that helps, you know that you could either set a maximum mipmap level (which can also be set in Quality settings) which not to exceed, or increase the padding. Theoretically you could also ensure your attachments are of size multiples of 8 and set padding to 0 or use atlas texture packing mode grid
(which is rather wasteful though). Mesh Attachments might however still potentially mess with your packing though, so it might be best to limit the mip level.
loi When unwanted lines appeared, I followed the suggestion to use GIMP to preserve color values in transparent pixels.
Glad to hear you're not setting mipmaps yourself. You used GIMP to do what then? I didn't quite get what image editing you needed to do on your exported atlas textures.
Harald I simply used GIMP to save the file.
Now that I think about it, I realize the point was to save the file with GIMP after working on it in Photoshop.
But what I actually did was import the PNG file that I had already brought into Unity, open it in GIMP, and save it again.
Looking back, that was a pretty meaningless action. lol
Since we were talking about GIMP, I decided to check the PSD file I created in Clip Studio using GIMP—just in case.
When I disabled the alpha channel, I saw a huge amount of unintended white outlines, just like in the tutorial video.
I realized these lines appeared in the same locations as the ones I saw when the image was scaled down in Unity.
In the video, it seems like they do the entire image editing process in GIMP and save it with transparency properly handled.
So my question is:
Can I fix and remove these white outlines in GIMP, even if the original file was created in Clip Studio?
- Editado
@"Harald"#p127232I increased the padding to 8 in Spine and set the mipmap limit to 2 in Unity’s Quality settings, but the same problem still occurred.
However, when I raised the padding to 16 and kept the mipmap quality at level 2, the problem seemed to be almost resolved.
That said, with both padding 8 and 16, the skirt texture still shows issues as seen in the image below.
Is there any solution for this?
loi There seems to be some confusion about what is shown in the Import Troubleshooting video, so I would like to first provide some additional explanation on that point.
This video demonstrates how to edit a page image after performing texture atlas packing.
For example, suppose you want to change the color of certain textures after they have been packed. If you attempt to edit them using Photoshop or Clip Studio, unfortunately, these software applications do not retain color information in semi-transparent areas, which can lead to artifacts in Unity.
However, by using GIMP, you can make edits without losing color information in semi-transparent areas. This video introduces the steps for doing so.
After reading your explanation, I’m not quite sure why GIMP is necessary in your case. If you are thinking of using GIMP to remove artifacts that have already appeared, please note that this differs from the intended use case demonstrated in the video.
If you export data created in Clip Studio as a PSD file, import it into Spine, pack it as usual, and then import it into Unity with the correct settings, artifacts should not normally occur.
That said, I tested the Unity package you sent us via email, and indeed, no matter how I changed the settings, enabling Generate Mipmap
resulted in a white seam appearing in the center of the skirt when zooming out the camera.
We will need some time to investigate why this issue occurs, I would appreciate it if you could wait for our response on this matter.
loi By the way, this is unrelated to the white seam issue caused by mipmaps, but I think you should combine the texture atlas pages for this skeleton into a single page. In the Unity package you sent us, your skeleton has three materials, but the Materials array in the MeshRenderer contains 33 entries due to an unorganized draw order. This is quite inefficient. If you haven’t already read the Rendering section of the documentation, I highly recommend doing so: https://esotericsoftware.com/spine-unity-rendering
A few general things:
1.) White pixels in your atlas texture: If you just export your atlas texture as straight alpha with bleed enabled (and this is recommended), you should always see the outermost perimeter color (black in case of your black outlines) in transparent regions when hiding alpha in a trustworthy image editor (e.g. GIMP), not white pixels (unless your outermost part was white). If you see unexpected white pixels then likely the image has been processed with an image editor which does not respect and changes RGB values in completely transparent pixels (like Photoshop does unfortunatley).
2.) Straight alpha vs. PMA: Note that if you are using Gamma color space, you could also use PMA instead of straight alpha workflow. This should improve the situation with mipmaps slightly as well. Don't expect it to solve all problems though.
Regarding your specific white lines problem
Misaki found out the following:
1) Stripe at the leg: This is indeed due to mipmaps blurring-over the white (or cream) part of the hair-attachment next to it:
So during atlas packing you need to add more padding here. Alternatively you could also disable Strip whitespace X|Y
which removes transparent areas during packing and instead manually add transparent areas yourself where you need them. The latter is more tedious though obviously than just increasing the padding to e.g. 8. Misaki confirmed the white line at the leg is no longer visible when increasing packing to 8.
Another alternative workaround could be to change the region attachment into a mesh attachment and cut the mesh more tightly at just the problematic parts.
2) Regarding the white line at the skirt:
This seems to be due to the skirt part overlapping a white cloth underneath, but covering it pretty precisely with not much "safety overlap". Now when mipmaps blur your covering top-layer skirt attachment texels together, an opaque covering black skirt texel and a transparent one are blurred together to a semi-transparent black one, showing the white parts underneath. This unfortunately is a theoretical problem with mip-maps again. This could be resolved by having wider black "safety-overlap" of the skirt attachments. Alternatively you could turn the skirt into a mesh attachment instead of multiple separate region attachments - when there are no attachment borders in the middle of the skirt, nothing can show through between them. It could also be resolved to make sure that there are no white parts underneath the black ones where there should be no white showing ever, so making the white cloth parts black in these areas or adding a black cover attachment in the middle if that's not possible.
I manually extended the skirt's border and set the padding to 32, then removed the alpha artifacts using AI — and it finally worked! The white lines are completely gone.
Thanks to your help, I can finally move on to making animations!
I was honestly close to giving up, but your explanation gave me a clear path forward.
Thank you so much again for your support. I’ll keep pushing forward with renewed motivation.
Wishing you a great day — and truly, thank you again!