• Runtimes
  • Spine-SDL dark borders around transparent areas

I get dark areas when rendering here is a sample of atlas file

size:1024,1024
filter:Linear,Linear
pma:true

and the code is this:
github.com/EsotericSoftware/spine-runtimes/blob/4.1/spine-sdl/example/main.cpp

problem footage:


Related Discussions
...

The dark borders around transparent areas in your Spine-SDL rendering are likely due to the use of premultiplied alpha (PMA) in your atlas file. The pma:true setting in your atlas file indicates that premultiplied alpha is enabled. However, the spine-sdl runtime does not support atlases exported using premultiplied alpha. To resolve this issue, you should export your texture atlases without premultiplied alpha. You can do this by opening the Texture Packer Settings window in Spine and unchecking the Premultiply alpha option before exporting your atlases.

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

    Spinebot Sadly I only have the .atlas.txt and .skel.bytes and .png not the source file I saw when viewing the file works fine in here Spine Viewer Online

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

      Ian It is possible to unpack and repack the texture without premultiplied alpha. The following article on our blog should help you with this procedure: https://esotericsoftware.com/blog/Importing-skeleton-data

      • Ian ответили на это сообщение.
      • Ian оценил это.
        • Изменено

        Misaki thank you for responding but I don't have a spine lincense also I want to solve in SDL runtime. Also I found some useful resource but I don't know how to adjust in SDL runtime Doc, Forum, Forum, doc

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

          Ian As described in the Exporting for SDL section of the documentation, the spine-sdl runtime does not currently support textures exported using pre-multiplied alpha. So if you want to use the skeleton, you will need to repack the textures without pre-multiplied alpha.

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

            Misaki Thank you for your help!

            Misaki Can I ask you if there is a way I could make a custom one for it. and also what kind of runtime support it? Thank you!

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

              Misaki and how much it will take for the function will be made by your team or is there a plan making the function?

              Ian

              Can I ask you if there is a way I could make a custom one for it.

              Yes, you can customize the Spine Runtimes to suit your needs. To customize the Runtime, you may find the general Spine Runtime Guide helpful: https://esotericsoftware.com/spine-runtimes-guide

              and also what kind of runtime support it?

              If you mean support for pre-multiplied alpha textures, there are many runtimes that support this. However, I do not know enough about your requirements to know which one to recommend. Among the lightweight runtimes, for example, spine-pixi supports them.

              Can I ask you if there is a way I could make a custom one for it. and also what kind of runtime support it?

              It is not always possible to support pre-multiplied alpha textures later, but in many cases it is unlikely that they will be supported later. In most cases, it is very difficult to support pre-multiplied alpha textures due to the nature of the engine or library. If the version of the engine or the library itself is upgraded and easier to implement, it may be supported.

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

              spine-sdl does already support premultiplied alpha. You just need to set SkeletonDrawable::usePremultipliedAlpha = true. The drawable currently does not interpret the flag in the atlas.

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

              Thank you for your help. I found the solution I removed the PMA with the script and it was solved! and @Mario I will check that too thank you!