GL_CULLDISTANCE(3G)

    .SH "NAME" gl_CullDistance - provides a mechanism for controlling user culling
    .SH "DECLARATION"

        .PP gl_CullDistance is a member of the gl_PerVertex named block:

    out gl_PerVertex {
        vec4 gl_Position;
        float gl_PointSize;
        float gl_ClipDistance[];
        float gl_CullDistance[];
    };

        .PP In fragment shaders, it is intrinsically declared as: in float gl_CullDistance[] ;

    .SH "DESCRIPTION"
        .PP The gl_CullDistance variable provides a mechanism for controlling user culling. The element gl_CullDistance[i] specifies a cull distance for each plane i. A distance of 0.0 means that the vertex is on the plane, a positive distance means that the vertex is inside the cull volume, and a negative distance means that the point is outside the cull volume. Primitives whose vertices all have a negative clip distance for plane i will be discarded.
        .PP The gl_CullDistance array is predeclared as unsized and must be sized by the shader either by redeclaring it with an size or by indexing it only with integral constant expressions. The size determines the number and set of enabled cull distances and can be at most gl_MaxCullDistances. The number of varying components consumed by gl_CullDistance will match the size of the array. Shaders writing gl_CullDistance must write all enabled distances, or culling results are undefined.
        .PP As an output variable, gl_CullDistance provides the place for the shader to write these distances. As an input in all but the fragment language, it reads the values written in the previous shader stage. In the fragment language, the gl_CullDistance array contains linearly interpolated values for the vertex values written by a shader to the gl_CullDistance vertex output variable.
        .PP It is a compile-time or link-time error for the set of shaders forming a program to have the sum of the sizes of the gl_ClipDistance and gl_CullDistance arrays to be larger than gl_MaxCombinedClipAndCullDistances.

    .SH "VERSION SUPPORT"
        .TS allbox tab(:); l l l l l l l l l l l l l. T{ gl_CullDistance T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}

    .SH "SEE ALSO"
        .PP gl_ClipDistance(), gl_PointSize()

    .SH "COPYRIGHT"
        .PP Copyright © 2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2014 Khronos Group