I am developing a VR application in Unity where I have a 3D object (a plane) flying over the player's head. I am using a Skybox for the background and I want to make the plane "disappear" behind a building. I placed a cube over the building and I want to make it transparent (such that I still see the skybox behind it) but make the plane disappear as you can see in this picture.
It seems to work "fine" as long as I don't move the camera, but as soon as I move it, some artefacts appear (see the picture below)
I am using a shader I found online:
{
Properties
{
}
SubShader
{
Tags { "RenderType" = "Opaque" "Queue"="Geometry-1" }
LOD 100
ZWrite On
ZTest Always
Blend Zero One
Pass
{
}
}
}
Can anyone give me some advice or guide me towards a tutorial on how to properly set up this shader?
Note that I am a real beginner in all this and have almost no idea how shaders work.