title: draw the depth value in opengl using shaders
body: <p>I want to draw the depth buffer in the fragment shader, I do this:</p>
  
  <p><strong>Vertex shader:</strong></p>
  
  <pre><code>varying vec4 position_;
  
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
  position_ = gl_ModelViewProjectionMatrix * gl_Vertex;
  </code></pre>
  
  <p><strong>Fragment shader:</strong></p>
  
  <pre><code>float depth = ((position_.z / position_.w) + 1.0) * 0.5;
  
  gl_FragColor = vec4(depth, depth, depth, 1.0);
  </code></pre>
  
  <p>But all I print is white, what am I doing wrong?</p>