I’m trying to figure out how to use a depth mask with the Google VR SDK,
at the moment I’m getting this funky outcome which is not what’s meant to happen.
The shader I am using is the one below with a Set Render queue script on GameObjects I’m punching holes through, everything works fine in the editor but appears messed up when testing on the Google Pixel 2
Shader "Masked/Mask" {
SubShader {
// Render the mask after regular geometry, but before masked geometry and
// transparent things.
Tags {"Queue" = "Geometry-10" }
// Don't draw in the RGBA channels; just the depth buffer
Lighting Off
ZTest LEqual // added this
ZWrite On
ColorMask 0
// Do nothing specific in the pass:
Pass {}
}
}
Additional info:
Unity 2017.4.12f1
GoogleVRForUnity_1.170.0
Using 32-bit Display Buffer
Color Space: Gamma
Graphics APIs:
-OpenGLES3
-OpenGLES2
Depth Format: 16-bit depth