• RuntimesUnity
  • Transparent objects don't look correct in linear colour space

I have some semi transparent objects in my spine project.

When I was exporting them with pre-multiplied alpha and unity was set to use gamma colour space everything looked fine.

I need to use linear colour space so I followed the instructions in the warning and re-exported the spine project with pre-multiplied alpha disabled. I also enabled the 'straight alpha texture' option on the materials. I found that the colours were all messed up until I also set the textures to sRGB in the import settings.

Now all of the opaque objects are looking correct but the semi transparent objects aren't, I'm not sure what is wrong.

This is what it looks like in spine (and how it looked in unity with PMA):

This is what it now looks like in unity:

As you can see the shape and the colour/transparency are both wrong.

The transparent part looks fine in the texture itself so the problem doesn't appear to be in the export.

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

    It seems like the issue you're experiencing is related to the mismatch between the export and import settings for straight alpha textures in Unity. Here are the steps to ensure everything is set up correctly:

    1. Export Settings in Spine:

      • Ensure that Premultiply alpha is disabled.
      • Enable Bleed.
    2. Import Settings in Unity:

      • Set sRGB (Color Texture) to enabled.
      • Enable Alpha Is Transparency.
      • Ensure that the Straight Alpha Texture parameter is enabled on the material.
    3. Check Color Space:

      • Make sure your project is set to use Linear color space via Project Settings -> Player -> Other Settings -> Color Space.
    4. Verify Texture and Material Settings:

      • Double-check that all textures and materials are configured according to the straight alpha workflow. This includes ensuring that the Straight Alpha Texture parameter is enabled on the materials and that the texture import settings match the straight alpha requirements.

    For more detailed information, you can refer to the Premultiplied vs Straight Alpha Import section of the spine-unity documentation.

    If the problem persists, it might be helpful to re-import the textures and re-apply the material settings to ensure no settings were missed.

    I believe that I have already done all of the things listed by spinebot apart from enabling bleed but that shouldn't effect this

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

      JDBB In general, it is recommended that you enable Bleed, so please enable Bleed unless you have a specific reason not to.
      Could you tell us what version of the spine-unity runtime you are using? We recently fixed a problem with how colors look in linear color spaces, so if you were using an older version, it may be fixed by updating to a newer version. The ticket for the fixed issue is here: EsotericSoftware/spine-runtimes2552

      JDBB I also enabled the 'straight alpha texture' option on the materials. I found that the colours were all messed up until I also set the textures to sRGB in the import settings.

      Please note that you should assign the respective presets in the Spine Preferences if you've changed from PMA to straight alpha workflow to save you some manual work on newly added assets:
      https://esotericsoftware.com/spine-unity-assets#Spine-Preferences

      Have you changed the Spine Editor to display Linear color space blending in the viewport settings as well? While it doesn't affect the export, it will make your reference incorrect.

      Sorry for the late reply. I believe we have decided to go with gamma instead of linear. If we change our plans again I will be sure to check out the things mentioned above. Sorry for wasting your time.

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

        JDBB There's no need to apologize! As long as you post in the forum, other users with similar questions can refer to that thread, so no question is ever wasted. If you have any problems again, please don't hesitate to ask us.

        • JDBB оценил это.