- Home /
How to visualize depth value of unlit line renderer?
Hi, I try to visualize a depth buffer. I use a second cam for this which is bound to an own game view. Everything is working fine, except for the depth values coming from a default unlit shader on a line renderer. Depth information are obviously there, since depth merge is working correctly (the green cam preview is the one of the "depth camera"). Also the FramDebugger shows the line drawing in the depth buffer. The shader for the depth image is pretty straight forward:
fixed4 frag (v2f input ) : SV_Target
{
float depth = tex2D( _CameraDepthTexture, input.uv ).r;
depth *= _ProjectionParams.z;
depth *= _DepthLevel;
return depth;
}
If I change to a standard lit shader, everything is ok. Why is that?
Your answer
Follow this Question
Related Questions
Rendering different shader when camera get near object 1 Answer
Intersection Highlight Shader -1 Answers
How to get the depth from custom shader objects in fragement shader 0 Answers
clipping issue with sprites in fixed camera scene 0 Answers
Scene Depth Node, find depth value from x/y position of camera frame 1 Answer