I need a surface shader that displays depth as grayscale. I think zbuffer is needed here. What I want to achieve is similar to this: Except, it is done using Vizualize option on new Depth Of Field image effect, and is, later on, not compatibile with other Image Effects because it just shows Depth Texture over Camera's rendering. I need 3 shaders: 1. Just plain grayscale depth surface shader. Example: http://answers.unity3d.com/questions/847344/increasing-the-level-of-detail-with-a-depth-render.html Except the shader there is not working in UNITY 5. 2. Standard shader combined with depth grayscale shader over it which transparency can be altered through slider. I think I could combine Standard and 1st shader myself. I want to make something similar to the game "WHICH". Screenshot: Thank you all for your time, and help. Cheers!
First normalize your depth buffer. Then convert it to gray scale color output, for example " return float4(normalizedDepth.xxx, 1); " Maybe in your case you need some other curve to achieve effect you need.
Care explaining a little bit more? I am not really good with shaders. What do you mean exactly by "normalizing depth buffer", and how could it be done?