title: OpenGL - How to access depth buffer values? - Or: gl_FragCoord.z vs. Rendering depth to texture
body: <p>I want to access the depth buffer value at the currently processed pixel in a pixel shader.</p>
  
  <p>How can we achieve this goal? Basically, there seems to be two options:</p>
  
  <ol>
  <li>Render depth to texture. How can we do this and what is the tradeoff?</li>
  <li>Use the value provided by gl_FragCoord.z - But: Is this the correct value?</li>
  </ol>