View Full Version : What is "application-defined clip distance"?

04-30-2011, 04:31 AM
I ran accross this symbolic constant in the glGet() spec:
params returns one value, the maximum number of application-defined clipping distances. The value must be at least 8. symbolic constant that "

"GL_MAX_CLIP_DISTANCES" I cannot find explained in any documentation online.

Does anyone know what it is or what a clip distance is exactly?

04-30-2011, 04:42 AM
It means that you can define at max 8 clipping planes in your applications.

04-30-2011, 11:06 AM
How comes that you haven't found explanation for the GL_MAX_CLIP_DISTANCES?

GL_MAX_CLIP_DISTANCES Defines the number of clip distances that are available per program. The minimum legal value is 8.
The user clipping is an extremely useful feature. gl_ClipDistance[i] - are values written by vertex shader in order to determine the distance from the clipping plane. The value itself is not important but the sign of that value.

05-01-2011, 08:35 AM
Thank you Aleksander I did not know about the gl_ClipDistance[] built-in variable.
All I knew was that the near & far clip planes were a result of setting up a projection matrix.