Page 1 of 1
Huatimes
参考附件,Spine 以JSON方式导出的图片有黑边,请问这个该如何解决。
You do not have the required permissions to view the files attached to this post.
1.5 years ago
- Huatimes
- Posts: 9
Erika
Hello! deactivate
你好! 在纹理包装设置中停用“预乘alpha”以删除黑色边框。
premultiply alpha
in the texture packing settings to remove the black border.你好! 在纹理包装设置中停用“预乘alpha”以删除黑色边框。
1.5 years ago
-
Erika - Posts: 2704
Huatimes
你好,禁用“预乘alpha”后没有颜色的透明部分好像是花屏效果,这个怎么解决,谢谢。
1.5 years ago
- Huatimes
- Posts: 9
Mario
Could you tell us what engine/runtime you are using? Unity? cocos2dx? Unreal Engine? Something else?
你能告诉我们你正在使用什么引擎/运行时吗? 统一?cocos2dx? 虚幻引擎? 别的什么?
你能告诉我们你正在使用什么引擎/运行时吗? 统一?cocos2dx? 虚幻引擎? 别的什么?
1.5 years ago
-
Mario - Posts: 2489
Huatimes
Hello,we are using Unity Engine, if I disable "premultiply", in unity it show like below in attachments:
---
I guess i know why, if i deactivate "premultiply alpha" in spine editor, then in unity i need check "Straight Alpha Texture" in material, right?
---
I guess i know why, if i deactivate "premultiply alpha" in spine editor, then in unity i need check "Straight Alpha Texture" in material, right?
You do not have the required permissions to view the files attached to this post.
1.5 years ago
- Huatimes
- Posts: 9
Harald
Yes, exactly. With premultiply alpha disabled, also make sure to enableHuatimes wrote:I guess i know why, if i deactivate "premultiply alpha" in spine editor, then in unity i need check "Straight Alpha Texture" in material, right?
Alpha is Transparency
and sRGB (Color Texture)
at the texture settings in Unity.So to sum it up:
Spine export settings:
Disable
Premultiply alpha
, enable Bleed
BleedAlpha.PNG
Unity import settings:
Texture: Enable
Alpha is Transparency
and sRGB (Color Texture)
StraightAlphaTextureSettings.png
Material: Enable
Straight alpha texture
StraightAlphaMaterialSettings.PNG
Are you using Linear color space? You can check that in
Project Settings - Player - Other Settings - Color Space
. In Linear color space only the straight-alpha workflow is supported. If you use Linear color space, then premultiply-alpha will create incorrect results, which would explain the black lines.The next unitypackage will provide warning messages when such incorrect combinations are detected.
I just thought it would be great to add a setting in the Unity Spine Preferences to quickly switch between workflows and have the settings automatically assigned correctly on import.
There is now an issue ticket here where you can subscribe to receive notifications on any updates:
https://github.com/EsotericSoftware/spine-runtimes/issues/1410
You do not have the required permissions to view the files attached to this post.
1.5 years ago
-
Harald - Posts: 2437
Huatimes
Thank you very much, and i want to know the meaning of the parm "Bleed", and whether i must check this option when i work in linear color space?
1.5 years ago
- Huatimes
- Posts: 9
Harald
Bleed is independent of color space, it should be enabled when using straight alpha (
Bleed affects the RGB part of pixels in semi-transparent areas, there it will "repeat" the RGB color of the closest opaque pixel, a bit like "smudging" color over into the transparent parts. E.g. have a texture of a green leaf with transparency at the outer parts, this will ensure that the 90% transparent green border pixel will still add 10% green to the scene, and not 10% black.
Above gif shows Spineboy's atlas texture in GIMP with
1) active alpha transparency
2) deactivated
3) active
Note that most image editors already add such a 'bleed' region in transparent areas when exporting, nevertheless I would still recommend to enable it in the Spine export settings to be sure and to have a better basis when enabling mipmaps (where more pixels will be sampled at the border and combined to a single one).
Premultiply alpha
disabled) textures.Bleed affects the RGB part of pixels in semi-transparent areas, there it will "repeat" the RGB color of the closest opaque pixel, a bit like "smudging" color over into the transparent parts. E.g. have a texture of a green leaf with transparency at the outer parts, this will ensure that the 90% transparent green border pixel will still add 10% green to the scene, and not 10% black.
ColorBleed.gif
Above gif shows Spineboy's atlas texture in GIMP with
1) active alpha transparency
2) deactivated
Bleed
with deactivated transparency to show the rgb colors underneath3) active
Bleed
with deactivated transparency to show the rgb colors underneath.Note that most image editors already add such a 'bleed' region in transparent areas when exporting, nevertheless I would still recommend to enable it in the Spine export settings to be sure and to have a better basis when enabling mipmaps (where more pixels will be sampled at the border and combined to a single one).
You do not have the required permissions to view the files attached to this post.
1.5 years ago
-
Harald - Posts: 2437
Huatimes
ok, i know, thank you very much again.
1.5 years ago
- Huatimes
- Posts: 9
Harald
For reference, to prevent further troubles:
There is now a section on correct
spine-unity Runtime Documentation: Advanced Premultiplied vs Straight Alpha Import
There is now a section on correct
Straight Alpha
vs Premultiplied Alpha
export and import settings in the updated spine-unity documentation pages here:spine-unity Runtime Documentation: Advanced Premultiplied vs Straight Alpha Import
1 year ago
-
Harald - Posts: 2437
Mark topic unread
• Page 1 of 1
Return to 中国Spine用户
- All times are UTC