title: [GLSL]How to compare the z value of all the vertices in world coordinate?
body: <p>This might be a simple question. As a newbie on GLSL, I would rather ask here.
  Now, in the vertex shader, I can get the position in world coordinate system in the following way:</p>
  
  <pre><code>    gl_Position = ftransform();
      posWorld = gl_ModelViewMatrix * gl_Vertex;
  </code></pre>
  
  <p>The question is: now can I can the max/min value of the posWorld among all the vertices? So that I can get a range of the vertex depth, but not the range of depth buffer.</p>
  
  <p>If this is not possible, how can I get the z value of near/far plane in world coordinate system?</p>
  
  <p>with best regards,</p>
  
  <p>Jian</p>