- Изменено
Black Outlines when Sprites are Lit with Spot/Point Light
Good day!
We're experimenting with lighting our spine assets using the Pixel Lit shader with Unity's built-in rendering pipeline, and we're wondering if there's something we can do about the black outlines around skeleton parts that show up when using spot/point lights.
In fact, we don't really understand why they're showing up in the first place. The phenomenon can be replicated with the sample spineboy asset. When lit with a directional light, it looks perfectly fine, but when spot/point light is affecting it, an outline can be seen around the mouth texture. We think this is some sort of depth texture-alpha cutoff issue, but the original texture as viewed in the Spine editor does not have such an outline (our own assets are the same—specifically drawn to not have outlines and instead fade out at overlapping areas). We can understand if the alpha cutoff removes a bit of the texture edge, but we don't understand why it would add a black outline when lit, and only with spot/point lights at that.
We'd appreciate if someone could explain the cause for the outlines, and more so if a potential solution could be offered. We have provided some screenshots to illustrate the issue.
Note: we are using linear color space and therefore exporting/importing straight alpha textures (with Bleed in spine editor).
Thank you in advance for your time!
RukichanNanodesu написалGood day!
Note: we are using linear color space and therefore exporting/importing straight alpha textures (with Bleed in spine editor).
This statement contradicts with the last screenshot you have posted (which shows your export settings to be completely the opposite).
These artefacts are caused by the PMA mismatch.
These are the set of options that shall be in sync:
- The settings in your last screenshot
- The settings on the spine material itself in unity called "Straight alpha texture"
We’re sorry to hear you're having trouble. We have confirmed that this problem can be reproduced with both straight alpha and PMA skeletons, even if the settings are correct. We will investigate the problem and let you know as soon as possible if we find the cause.
Thanks @vhristov for chiming in, always appreciated! Your observations of the last screenshot were correct, unfortunately the issue even occurs with correct setup.
We have just committed a bugfix for the problem, a new 4.1 unitypackage is available for download here as usual:
spine-unity Download
Please let us know whether this resolves the problem on your end as well. Thanks for reporting!
In case anyone is interested in the cause of this problem, the issue ticket can be found here:
https://github.com/EsotericSoftware/spine-runtimes/issues/2147
Seeing the fix, I could argue it is still PMA related Just not where I expected when I saw the screenshot.
Sorry for the noise, I was just sure it was a mismatch in the settings, because I don't see such an issue on my project (which uses URP, but I completely missed that it was about the built-in renderer).
Thank you very much for your prompt response. Upon review, we noticed that we posted an incorrect screenshot regarding our spine export settings. We opened a new project for demonstration purposes and forgot to set the export to Bleed instead of PMA, but the assets we tested with were indeed straight alpha, and the problem was persistent, as mentioned by previous posters.
The updated spine runtime seems to have fully resolved the problem. We apologize for the screenshot mix-up and extend our sincerest gratitude to the Spine team for their swift support.
vhristov написалSeeing the fix, I could argue it is still PMA related
Almost , the issue is independent of PMA and straight alpha, but the fix requires an additional line to fix the PMA code branch as well.
RukichanNanodesu написалThank you very much for your prompt response. Upon review, we noticed that we posted an incorrect screenshot regarding our spine export settings.
No need to apologize, we recognized that it was just the screenshot which was incorrect, and not your actual project setup.
RukichanNanodesu написалThe updated spine runtime seems to have fully resolved the problem.
Thanks for the quick feedback, very glad it resolved the problem on your end as well!