'\" t .\" Title: gl_CullDistance .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 01/03/2018 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GL_CULLDISTANCE" "3G" "01/03/2018" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" gl_CullDistance \- provides a mechanism for controlling user culling .SH "DECLARATION" .PP \fIgl_CullDistance\fR is a member of the \fIgl_PerVertex\fR named block: .sp .nf out gl_PerVertex { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]; float gl_CullDistance[]; }; .fi .PP In fragment shaders, it is intrinsically declared as: in\ \&float\ \&gl_CullDistance[]\ \&; .SH "DESCRIPTION" .PP The \fIgl_CullDistance\fR variable provides a mechanism for controlling user culling\&. The element \fIgl_CullDistance\fR[\fIi\fR] specifies a cull distance for each plane \fIi\fR\&. A distance of 0\&.0 means that the vertex is on the plane, a positive distance means that the vertex is insider 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 \fIi\fR will be discarded\&. .PP The \fIgl_CullDistance\fR 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 \fIgl_MaxCullDistances\fR\&. The number of varying components consumed by \fIgl_CullDistance\fR will match the size of the array\&. Shaders writing \fIgl_CullDistance\fR must write all enabled distances, or culling results are undefined\&. .PP As an output variable, \fIgl_CullDistance\fR 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 \fIgl_CullDistance\fR array contains linearly interpolated values for the vertex values written by a shader to the \fIgl_CullDistance\fR 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 \fIgl_ClipDistance\fR and \fIgl_CullDistance\fR arrays to be larger than \fIgl_MaxCombinedClipAndCullDistances\fR\&. .SH "VERSION SUPPORT" .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ \fBOpenGL Shading Language Version\fR T} T{ \fBVariable Name\fR T}:T{ \fB1\&.10\fR T}:T{ \fB1\&.20\fR T}:T{ \fB1\&.30\fR T}:T{ \fB1\&.40\fR T}:T{ \fB1\&.50\fR T}:T{ \fB3\&.30\fR T}:T{ \fB4\&.00\fR T}:T{ \fB4\&.10\fR T}:T{ \fB4\&.20\fR T}:T{ \fB4\&.30\fR T}:T{ \fB4\&.40\fR T}:T{ \fB4\&.50\fR T} .T& l c c c c c c c c c c c c. 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} .TE .sp 1 .SH "SEE ALSO" .PP \fBgl_ClipDistance\fR(), \fBgl_PointSize\fR() .SH "COPYRIGHT" .PP Copyright \(co 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\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 2014 Khronos Group .br