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:
gl_Position = ftransform();
posWorld = gl_ModelViewMatrix * gl_Vertex;
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.
If this is not possible, how can I get the z value of near/far plane in world coordinate system?
with best regards,
Jian