Shader "Masked/Mask" {
SubShader {
// Render the mask after regular geometry, but before masked geometry and
// transparent things.
Tags {"Queue" = "Geometry-1" }
// Don't draw in the RGBA channels; just the depth buffer
ColorMask 0
ZWrite On
// Do nothing specific in the pass:
Pass {}
}
}
The issue is that transparent plane is shown as black pixels in some android phones.
I have tested the hole in Samsung S7 and Huawei Mate 20 Pro and it is working fine but same apk will produce black pixels, e.g. Samsung Galaxy S9. I am worried that this will be common to many other phones as well.
Any solution on how to fix this. Is this a bug on unity or it is something else?
Picture on top is the correct one and the bottom is how it looks like on Samsung Galaxy S9.
[181736-解决.png|181736]Year 2021 here, It’s due to the default API in player settings of android is Vulkan, drag the OpenGLES 3 up to make it default API.
For those of older unity version and graphics APIs, I guess it’s also relative to graphics API bugs in unity, so try to change your graphics API might help