Render on top
Hi!
Following usecase: I want an object (e.g. a plane) with a texture rendered in front of the camera (about 0,5 units). The texture is in a way that a "hole" is in the middle you can see through. It all works fine, except that objects that get very close to the camera get in front of the plane and can be seen (of course). The easiest way would be to render the texture on top of everything, so that also when objects are in front of it the still seem to be behind it. I tried it with the UI shader and it works kind of, except that throug the plane things are seen very slightly (using vr). This affect does not appear in the editor/main monitor, only the hmd. Any idea or simple shader for vr to render a material on top of everything?
Thanks! Hannes
Answer by Giantbean · Dec 14, 2019 at 03:04 PM
Not sure if this is what you want but its worth a try:
Shader "Custom/InvisibleMask" {
SubShader {
// draw after all opaque objects (queue = 500):
Tags { "Queue"="Transparent+1" }
Pass {
Blend Zero One // keep the image behind it
}
}
}
See also https://answers.unity.com/questions/316064/can-i-obscure-an-object-using-an-invisible-object.html
Your answer
Follow this Question
Related Questions
Volumetric Light with VR in URP have a weird clipping... Any ideas? 0 Answers
Applying a UI-Overlay-Shader on a Canvas. Problems! 0 Answers
How to set a render-to-texture camera to be a VR camera 0 Answers
Antichamber-like shader for lights and outline? 0 Answers
Google VR (Cardboard) don't work with Render Pipeline Asset. 0 Answers