• RuntimesUnity
  • Problems with alpha chanel

Hi, i got problems with exporting atlas. When i click premultipli alpha, all opacity are gray. And when i click bleed (or nothing) all images have white background. In spine ewerything looks ok, buy after exporting in unity are problems. How corectly export atlas?

Sorry for my language.

Related Discussions
...

When exporting an atlas from Spine to Unity and encountering issues with the alpha channel, such as gray opacity with "Premultiply alpha" enabled or a white background with "Bleed" enabled (or neither), it's important to ensure that your export settings in Spine and import settings in Unity are correctly configured to match each other. If you're using "Premultiply alpha" during export, make sure Unity is set up to handle premultiplied alpha textures. This often involves selecting the correct shader in Unity that supports premultiplied alpha (e.g., a Spine shader specifically designed for premultiplied alpha textures). If you're not using "Premultiply alpha," enabling "Bleed" can help avoid artifacts at the edges of your images, but you also need to ensure that your Unity project is set up to correctly interpret straight alpha textures.

For straight alpha textures, ensure that the "Straight Alpha Texture" option is enabled in the material properties in Unity, and that you're using a shader that supports straight alpha. Additionally, adjusting Unity's import settings for the texture to enable "sRGB Color Texture" and "Alpha is Transparency" can help ensure correct display of the alpha channel.

It's also worth noting that modifying the atlas texture directly in an image editor after export (e.g., Photoshop) can introduce issues if the editor does not respect the premultiplied alpha settings or if the correct alpha handling is not reapplied after editing. For detailed guidance on handling premultiplied vs. straight alpha in Unity, refer to the spine-unity documentation.

  • Harald ответили на это сообщение.

    You may also benefit from this video:

    Spinebot This often involves selecting the correct shader in Unity that supports premultiplied alpha (e.g., a Spine shader specifically designed for premultiplied alpha textures).

    Spinebot worded this a bit strangely, which might be misunderstood. The Spine shaders that come with the spine-unity runtime cover both straight alpha and PMA workflows. By default, the Spine shaders assume premultiplied-alpha texture, if you exported with straight alpha instead you have a checkbox Straight Alpha Texture at the Material which you need to check.