I do some basic stuff
1) calculate my position
2) store it into "gl_Position"
3) then i store my depth into a vec2 based on my position info
gl_Position = vec4( vVertexPos, 1 ) * mMVP;
vDepth = gl_Position.zw;
vDepth is a variable above in my shader that i pass to my fragment shader
out vec2 vDepth;
in the fragment shader i store the fragment depth in gl_FragDepth
gl_FragDepth = vDepth.x / vDepth.y;
my depth values are all near the value of 1. Am I doing something incorrect? Might I be missing a step that will give me my linear depth values? when i calculate my camera info my near clipping is 0.01 and my far clipping is 200.0f i need the near to be around that clipping space.