我在为Mobile Unity Project创建一个简单的着色器时遇到问题。
Shader "Custom/InvisibleMask"
{
SubShader
{
// draw after all opaque objects (queue = 2001):
Tags { "Queue" = "Geometry+1" }
Pass
{
Blend Zero One // keep the image behind it
}
}
Fallback "Diffuse"
}
此着色器仅隐藏RenderQueue大于“ Geometry + 1”的GameObject,并显示小于“ Geometry + 1”的GameObject。下图显示了冰箱顶部和底部的故障。
出于某些奇怪的原因,此着色器无法在某些Android设备(例如Moto G5和Moto G5 Plus)上运行。
我正在使用Unity 2019.2.15。
我在Internet上搜索了很多此bug的解决方案,但是找不到遇到相同问题的人。我必须去测试不同的配置,直到发现问题。我发现问题是Unity与Vulkan API集成失败或仅仅是Vulkan API失败。
要解决该问题,只需转到Android项目设置并删除Vulkan图形API。