• RuntimesUnity
  • White seams when using Bleed + Straight Alpha with Unity on Android

Hi there, we are using Spline in our Unity mobile game and are trying to switch from the Pre-multiplied Alpha to the Straight Alpha + Bleed configuration and are having issues on our Android and iOS builds. The reason we wanted to switch is because we were getting significant artifacts in when using any form of compression, and the Straight Alpha pipeline was recommended for users in this situation.
In editor, the characters look perfect no matter the compression settings (even crunch), however on Android devices at least there is a distinctive white outline at the joins of the characters. I've search the forums and not been able to find a solution.

We have followed the documentation as best we can but I'm not sure what export settings we might need to change. We've tried a few different things but get the same problem each time. Here's our export settings for reference:

    Related Discussions
    ...

    lindsayt If you have the correct material settings in Unity, your texture packer settings should be fine.
    Have you checked the FAQ section of the spine-unity documentation? The "Visual" section of the FAQ covers most of the causes of black or white border problems around transparent areas of the attachment images, so check it out if you haven't already: http://esotericsoftware.com/spine-unity#Visual

      @lindsayt If none of the FAQ answers applies, have you tried switching Texture Packer Settings Packing from Polygons to Rectangles?

      lindsayt In editor, the characters look perfect no matter the compression settings (even crunch), however on Android devices at least there is a distinctive white outline at the joins of the characters.

      If none of the above helps: Are you sure that you are not previewing with better texture quality settings (uncompressed ) in the Unity Editor?

        Harald
        I can confirm the values are correct in editor as the quality does change when I use other settings. I haven't tracking packing Rectangles yet and will get our artist to try and re-export with that.

        Misaki
        All the material and texture settings appear to be correct. In the Spine Presets I don't have any of the materials set and my project doesn't have the mentioned Straight materials. Unless I'm mistaken this is just to help automatically configure the materials and isn't strictly necessary?

        In the documentation it says the if you use Linear Colour you must use Straight Alpha. Does that also mean that you need Liner Colour to use the Straight Alpha pipeline or is that optional?

          lindsayt

          In the Spine Presets I don't have any of the materials set and my project doesn't have the mentioned Straight materials.

          Hmmm, that sounds weird. Could you tell us what version of Unity and spine-unity runtime you are using?

          Unless I'm mistaken this is just to help automatically configure the materials and isn't strictly necessary?

          Yes, the materials set in the Auto-Import Settings in the Spine section of Preferences just set the materials that will be automatically assigned upon import, and can be manually modified to the correct settings. However, it is easy to make a mistake if you do this manually, so we basically advise users to modify the settings here depending on whether you are using PMA or Straights alpha textures.

          In the documentation it says the if you use Linear Colour you must use Straight Alpha. Does that also mean that you need Liner Colour to use the Straight Alpha pipeline or is that optional?

          Straight alpha textures can be used in both Gamma and Linear color space.


            Okay I did have some settings that were a bit off. But updating them appear to have made it much worse. For clarity, here is the import settings for the texture and the material.
            Does it matter if other skins on the same atlas haven't been updated? This character has 4 skins but we're only testing this one with the new export pipeline as it's a time consuming process

            @lindsayt Your settings look correct, sorry that none of the suggestions resolved your issue. Could you please send us a minimal Unity project which still shows your issue as a zip package? Please also include your Spine project files, including the attachment images folder. You can send it to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context. Then we can have a look at what's going wrong.

            entirely unrelated, but @lindsayt OMG I can't wait for a Lower Decks Android game 😃

              6 gün sonra

              Mario It's already live and I'm working to make it a bit more optimized. Check it out

              6 gün sonra

              Misaki
              Just confirmed we are using Spine 3.8.99 and Unity 2021.3.24f1
              We investigated updating to Spine 4.2 but it was not feasible for this project.
              I'll try and create a project to send through when I can, but that may take a while

                lindsayt
                I'll try and create a project to send through when I can, but that may take a while
                I did a quick project with just the one Spine character. Same files, same Unity version. Copy pasted all the build and quality settings. Looks perfect on this other project. What gives?

                  lindsayt We investigated updating to Spine 4.2 but it was not feasible for this project.

                  I assume you meant Spine 4.1, since 4.2 is not yet out.

                  I did a quick project with just the one Spine character. Same files, same Unity version. Copy pasted all the build and quality settings. Looks perfect on this other project. What gives?

                  Please note that the Spine Preferences settings like default import settings are stored in the file SpineSettings.asset, by default located in Assets/Editor, outside the Project Settings folder.

                  If you can later send us your reproduction project files, we're happy to have a look at what's the cause of your troubles.

                    Also when you use straight alpha+bleed you have to manually adjust channels in unity prefrences>spine window.

                    Harald
                    Spine prefs are also the same across both projects.

                      lindsayt Spine prefs are also the same across both projects.

                      Thanks for checking. Please note that Spine Preferences only affect the first import of your skeleton asset. When copying your newly exported Straight-Alpha texture assets over PMA existing ones, the Spine Preferences Atlas Texture Settings preset is not applied, to not mess with your manually tweaked settings. Nevertheless, the Texture import settings and Material settings screenshots that you shared earlier already look correct.

                      I assume you also receive the same issue when placing the exported assets in a newly created folder, right? So that no previous settings could mess up the import.

                        Harald I have narrowed down the issue to the BlendModeMaterialsAsset. We currently have a mix of PMA and Straight Alpha assets as it is going to take a long time to re-export them all. If I create an asset and build the scene with it, it works. If I create the asset at runtime it's using the Default Blend Mode Materials Asset to replace the Material at runtime with an incorrect one. The documentation says this is obsolete but I don't know if this applies to Spine 3.8 as the "Upgrade" button that's mentioned is not present. In the project there is only the PMA materials, is there supposed to be the Straight Alpha ones as well or is this specific to PMA?

                          The documentation says:

                          If you have disabled Premultiply alpha, set Atlas Texture Settings to StraightAlphaTexturePreset and blend mode materials to SkeletonStraightAdditive, SkeletonStraightMultiply and SkeletonStraightScreen

                          But those files don't exist. I re-downloaded the 3.8 runtime and they're not there either

                          lindsayt We currently have a mix of PMA and Straight Alpha assets as it is going to take a long time to re-export them all.

                          Sorry to hear. To save you some trouble for future projects, please note that it is highly recommended to automate your exports using the Spine Command Line Interface (CLI) to be able to quickly re-export your skeletons in one go.

                          The documentation says this is obsolete but I don't know if this applies to Spine 3.8 as the "Upgrade" button that's mentioned is not present.

                          Sorry for the confusion. In spine-unity 3.8 it was not yet obsolete as the new alternative did not exist yet, so you have to use the SkeletonData Modifiers - BlendModeMaterialsAsset in 3.8.

                          Regarding straight alpha blend mode materials:
                          spine-unity 3.8 did not yet provide straight alpha option at the blend mode shaders out of the box. Please download the latest spine-unity 4.1 shaders (additive, multiply and screen) and straight alpha materials (again additive, multiply and screen variants) from github here:

                          Or alternatively import the same 3 shaders and 3 materials from a newly downloaded spine-unity 4.1 unitypackage.