昨天在实现一个Unity屏幕特效一直不能成功,后来发现原因是实现该功能需要Unity Pro版本。
具体如下
void Start() {
if (SystemInfo.supportsImageEffects == false) {
enabled = false;
return;
}
if (curShader != null && curShader.isSupported == false) {
enabled = false;
}
}
Start()有检查是否支持,看不到效果,是被return掉了。
然后我屏蔽了这段代码,出现下面的报错
can't use image filters (not-RT are not supported or RT) ***
Google了一下,在Stack OverFlow 找到了答案:
Image filters are only supported in Unity Pro.
因为用到了OnRenderImage,在Unity 帮助文档看到以下
OnRenderImage is called after all rendering is complete to render image
postprocessing effects (Unity Pro only).
OnRenderImage在所有渲染完成后被调用,来渲染图片的后期处理效果(仅限UnityPro)
oh~~~
在尝试使用Unity实现屏幕特效时遇到困难,发现需要升级到UnityPro版本才能支持所需功能。文章深入探讨了如何通过代码检查来判断是否支持特定功能,并详细解释了在Unity中使用OnRenderImage进行后期处理效果的限制。最后,强调了从Unity社区获取正确答案的重要性。
1622

被折叠的 条评论
为什么被折叠?



