- 수정됨
How to enable pre-multiplied alpha in csharp runtimes
Hi, everyone. I'm using spine runtime for c# (version 3.5.51, downloaded from github) to render an animation, and I run into a problem. In the rendered animation there are some extra black borders, similar to what this image shows: Image removed due to the lack of support for HTTPS. | Show Anyway
(image from http://en.esotericsoftware.com/forum/Premultiplied-Alpha-Guide-3132)
I believe I need to enable pre-multiplied alpha in the runtime, as is suggested in the above post; but I can't find such an option. I can only find
SlotData.BlendMode
, which seems to have no influence to my situation.
So what should I do to enable pre-multiplied alpha rendering in spine c# runtime? I would apprectiate it if anyone can help.
The spine-csharp runtime is a C# runtime implementation, but it is game toolkit agnostic, so it doesn't contain anything to render images. Rendering is implemented on top of spine-csharp, for example like spine-unity or spine-xna. What are you using to render?
I would also suggest using 3.8 if possible.
@Nate:
Thank you for your reply! You are right and I'm making a stupid mistake. I'm using a project from github based on the c# runtime, which can do the rendering in winform applications. So I need to dig into that part instead of spine runtime for this option. I will try to figure it out then (and the question seems to become irrelevant to this forum...)
As for the version problem, I have to use 3.5.51 to match the source file version... it's a bit inconvenient that runtimes of new versions aren't compatible with old files. Anyway, thank you for your advice! Have a good day!
foxb612 wrote'm using a project from github based on the c# runtime, which can do the rendering in winform applications. So I need to dig into that part instead of spine runtime for this option.
Another option is to just use straight alpha: when you export your texture atlas, you don't have to check the PMA option.
foxb612 wroteI have to use 3.5.51 to match the source file version... it's a bit inconvenient that runtimes of new versions aren't compatible with old files.
True, it is a little inconvenient. FWIW, it's done that way so that the runtimes don't get bloated by needing to load data from all older versions. To use 3.8 I guess you'd need to update the winforms runtime to 3.8, which may be pretty easy.
Nate wrote
I have solved this problem by letting the program treat the image as PRGBA pixel format instead of RGBA in the rendering part. (not so difficult as what I thought lol) Thank you again for the information!