I'm currently working with a spine-sdl runtime: https://github.com/GerogeChong/spine-sdl
I've ported it to the latest version of spine, sdl, and to c++. It's been working fine up until recently, when our graphic artist noticed some weird bugs with transparency.
As it turns out our artist has been giving us premultiplied spine assets and we've been rendering them as unpremultiplied.
So I went back, tweaked our implementation a bit to use premultipled; and... didn't work. We started getting weird graphic glitched on objects that are supposed to be premultiplied where hidden attachments or zero alpha objects sorta having this burn in effect.
I'm guessing this all comes back to our runtime implementation. I did some testing and more or less this is what's happening:
So I think this should be rendered where all of the attachments are invisible, but for whatever reason they're not. So I thought maybe the runtime wasn't skipping null attachment's, but I looked over the rendering code and that looks right:
for (int i = 0; i < skeleton->getDrawOrder().size(); i++)
{
//skeleton is of type Skeleton*
Slot* slot = skeleton->getDrawOrder()[i];
Attachment* attachment = slot->getAttachment();
if (!attachment)
{
continue; //I would think that this line would cause the renderer to skip invisible attachments
}
//rendering logic
}
Interestingly, when I actually play the attachment, things behave weirdly in a different respect:
The flow for this animation is, enabled all attachments, set their alpha to zero, and gradual fade them in and out.
Premultiplied does this weird thing where it gets super bright and wrong
However Straight Alpha works as expected.
Does anyone have any idea what might be causing this. I'm seriously just really confused by all of it.