I know that there are plenty of questions out there related to rendering order:
- Forcing a GameObject to the highest depth (closest to camera) - Questions & Answers - Unity Discussions
- Rendering Order - Questions & Answers - Unity Discussions
and more closely related to my issue
However, I’m either misunderstanding this whole concept, or I’m doing something wrong, because I just can’t get it to work at all.
What I want to do is: make sure that a certain object / material / shader is rendered on top of everything else in the scene. That is to say: set the shader to a queue sometime after all the other geometry is rendered, clear the depth buffer, and then render the object so that it appears ‘written over’ the rest of the scene. That way, no matter what other objects get between it and the camera it will always be drawn on top.
I know that this can be done with multiple cameras, but we run into the same problems as the last example above: trying to manage a whole bunch of cameras, framerates dropping, etc. From other folks’ statements (e.g. the top example above that talks about drawing a gizmo that is inside a mesh object) it sounds like what I’m trying to do should be possible, but I’ve tried changing the shader tags, the renderQueue of the material, and everything else I can think of, and nothing seems to have an effect on the depth buffer.
Does the queue actually do what I’m trying to do here, or if not is there another way to do it at any level (shader, object, camera) without resorting to one camera for each object?