PDA

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



PrestoChung
04-30-2011, 03:31 AM
I ran accross this symbolic constant in the glGet() spec:
"GL_MAX_CLIP_DISTANCES
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?

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

Aleksandar
04-30-2011, 10: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.

PrestoChung
05-01-2011, 07: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.