• 中文
  • unity 描边出现奇怪问题

Related Discussions
...

unity 2020.3版本
spine3.8版本
Urp

为什么spine会出现蓝色预乘的部分。感觉很奇怪,试了很多方法不知道是什么原因,谢谢大佬帮忙解决下。感谢!

恐怕我们需要更多信息才能提供帮助,我们无法重现您的问题。 我们不知道您的实际着色器和场景设置。 您能否向我们发送一个仍然显示此问题的最小 Unity 项目? 您可以将下载链接附加到论坛帖子,也可以将其作为 zip 包发送到 contact@esotericsoftware.com,简要提及此论坛主题的 URL,以便我们了解上下文。


I'm afraid we need more info to be able to help, we could not reproduce your issue. We don't know your actual shader and scene setup. Could you please send us a minimal Unity project that still shows this problem? You can send either a download link attached to a forum post or you can send it as a zip package to contact@esotericsoftware.com, briefly mentioning the URL of this forum thread so that we know the context.

Urp HDR 选项勾选后就没有蓝变得问题,项目中需要使用到HDR的话如何解决蓝边的问题?
unity项目和Spine动画源文件已发送邮箱
期待您的回复

感谢您的报告,这个与轮廓渲染和启用“HDR”设置有关的问题刚刚在 4.0 和 4.1-beta 分支上得到修复。新的spine-unity和URP着色器UPM包在这里像往常一样可用:
Spine Unity Download: Download

发票供以后参考:
https://github.com/EsotericSoftware/spine-runtimes/issues/2001

如果要将其集成到 3.8,则需要更新 Spine-Outline-Common.cginc 中的以下行:
替换这一行:

float outlineAlpha = saturate((average - thresholdStart) / (ThresholdEnd - thresholdStart)) - pixelCenter;

用这条线

float outlineAlpha = saturate(saturate((average - thresholdStart) / (ThresholdEnd - thresholdStart)) - pixelCenter);

此更改在现有代码周围添加了一个 saturate() 调用。

请注意,在使用 UPM 包时,有两个名为“Spine-Outline-Common.cginc”的文件。这两个文件都应按上述方式更新:

com.esotericsoftware.spine.urp-shaders-3.8-2019.3\Shaders\Include\SpineCoreShaders\Spine-Outline-Common.cginc
Assets\Spine\Runtime\spine-unity\Shaders\CGIncludes\Spine-Outline-Common.cginc

Thanks for reporting, this issue with outline rendering and enabled HDR setting has just been fixed on the 4.0 and 4.1-beta branches. New spine-unity and URP shaders UPM packages are available here as usual:
Spine Unity Download: Download

Issue ticket for later reference:
https://github.com/EsotericSoftware/spine-runtimes/issues/2001

If you want to integrate it to 3.8, you need to update the following line in Spine-Outline-Common.cginc:
Replace this line:

float outlineAlpha = saturate((average - thresholdStart) / (ThresholdEnd - thresholdStart)) - pixelCenter;

with this line

float outlineAlpha = saturate(saturate((average - thresholdStart) / (ThresholdEnd - thresholdStart)) - pixelCenter);

This change adds one saturate() call around the existing code.

Note that there are two files called Spine-Outline-Common.cginc when using the UPM package. Both files should be updated as described above:

com.esotericsoftware.spine.urp-shaders-3.8-2019.3\Shaders\Include\SpineCoreShaders\Spine-Outline-Common.cginc
Assets\Spine\Runtime\spine-unity\Shaders\CGIncludes\Spine-Outline-Common.cginc
год спустя

备注,出现这个问题是由于spine制作时使用了透明度为0进行隐藏,但是在shader逻辑中没有把顶点色计算进去,会出现把本来隐藏的内容也绘制出来的问题。

谢谢(你的)信息。 如果您的帖子是一个问题,而机器翻译未能正确翻译,请不要犹豫,让我们知道。


Thanks for the info. In case your posting was a question and machine translation failed to translate it properly, please don't hesitate let us know.