title: How to fill depth buffer manually using OpenGL and GLSL
body: <p>I did a lot of researches on how filling the depth buffer manually without success. Until here, all I know is a depth texture (GL_DEPTH_COMPONENT) attached to a FBO is filled automatically by OpenGL during the render pass.</p>
  
  <p>For exemple, the following fragment shader code works:</p>
  
  <pre><code>/*
  ** Output pixel color value.
  */
  layout (location = 0) out float FragmentDepth;
  
  /*
  ** Fragment shader entry point.
  */
  void main(void)
  {
       //Depth filled automatically
  }
  </code></pre>
  
  <p>So if I write the following line of code into the main:</p>
  
  <pre><code>FragmentDepth = 0.0f; //the texture should be black
  </code></pre>
  
  <p>the result is the same!</p>
  
  <p>So I wonder how it's possible to "tell" to OpenGL do not write automatically in the depth buffer and takes into account my depth equation?</p>
  
  <p>I tried glDepthMask(false) function but of course this solution not work!</p>
  
  <p>Actually, I'd like to customize my depth buffer filling and do not depend on the action of OpenGL in background.</p>
  
  <p>How can I do this?</p>
  
  <p>Is the only way is to use a color buffer (like GL_RGB texture format) to store depth values manually ?</p>
  
  <p>Thanks a lot in advance for your help!</p>