include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / manglsl / gl_Position.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="gl_Position">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>gl_Position</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>gl_Position</refname>
17 <refpurpose>contains the position of the current vertex</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <para>
21 <function>gl_Position</function> is a member of the <function>gl_PerVertex</function>
22 named block:
23 </para>
24 <funcsynopsis>
25 <programlisting><![CDATA[ out gl_PerVertex {
26 vec4 gl_Position;
27 float gl_PointSize;
28 float gl_ClipDistance[];
29 };]]></programlisting>
30 </funcsynopsis>
31 </refsynopsisdiv>
32 <refsect1 id="description"><title>Description</title>
33 <para>
34 In the vertex, tessellation evaluation and geoemtry languages, a single
35 global instance of the <function>gl_PerVertex</function> named block is available and
36 its <function>gl_Position</function> member is an output that receives the
37 homogeneous vertex position. It may be written at any time during shader execution.
38 The value written to <function>gl_Position</function> will be used by primitive assembly,
39 clipping, culling and other fixed functionality operations, if present, that operate on
40 primitives after vertex processing has occurred.
41 </para>
42 <para>
43 In the tessellation control language, the <function>gl_PerVertex</function> named block
44 is used to construct an array, <function>gl_out[]</function>, whose <function>gl_Position</function>
45 members hold the homogeneous control point position, which become available as inputs to the subsequent
46 tessellation evaluation shader.
47 </para>
48 <para>
49 The value of <function>gl_Position</function> (or the <function>gl_Position</function> member of the <function>gl_out[]</function>
50 array, in the case of the tessellation control shader)
51 is undefined after the vertex, tessellation control, and tessellation evaluation
52 shading stages if the corresponding shader executable does
53 not write to gl_Position. It is also undefined after the geometry processing stage if the geometry shader executable calls
54 <citerefentry><refentrytitle>EmitVertex</refentrytitle></citerefentry> without having
55 written <function>gl_Position</function> since the last call to <citerefentry><refentrytitle>EmitVertex</refentrytitle></citerefentry>
56 (or hasn't written it at all).
57 </para>
58 <para>
59 In the tessellation control, tessellation evaluation and geoemetry languages,
60 the <function>gl_PerVertex</function> named block is used to construct an array, <function>gl_in[]</function>
61 of per-vertex or per-control point inputs whose content represents the corresponding
62 outputs written by the previous stage.
63 </para>
64 </refsect1>
65 <refsect1 id="versions"><title>Version Support</title>
66 <informaltable frame="topbot">
67 <tgroup cols="3" align="left">
68 <colspec colwidth="1.1*" />
69 <colspec colwidth="1*" align="center" />
70 <colspec colwidth="1*" align="center" />
71 <colspec colwidth="1*" align="center" />
72 <colspec colwidth="1*" align="center" />
73 <colspec colwidth="1*" align="center" />
74 <colspec colwidth="1*" align="center" />
75 <colspec colwidth="1*" align="center" />
76 <colspec colwidth="1*" align="center" />
77 <thead>
78 <row>
79 <entry rowsep="1" align="left"><emphasis role="bold">
80 Variable
81 </emphasis></entry>
82 <entry rowsep="1" align="left"><emphasis role="bold">
83 Version 1.10
84 </emphasis></entry>
85 <entry rowsep="1" align="left"><emphasis role="bold">
86 Version 1.20
87 </emphasis></entry>
88 <entry rowsep="1" align="left"><emphasis role="bold">
89 Version 1.30
90 </emphasis></entry>
91 <entry rowsep="1" align="left"><emphasis role="bold">
92 Version 1.40
93 </emphasis></entry>
94 <entry rowsep="1" align="left"><emphasis role="bold">
95 Version 1.50
96 </emphasis></entry>
97 <entry rowsep="1" align="left"><emphasis role="bold">
98 Version 3.30
99 </emphasis></entry>
100 <entry rowsep="1" align="left"><emphasis role="bold">
101 Version 4.00
102 </emphasis></entry>
103 <entry rowsep="1" align="left"><emphasis role="bold">
104 Version 4.10
105 </emphasis></entry>
106 </row>
107 <row>
108 <entry>
109 gl_Position
110 </entry>
111 <entry>
112 <emphasis>Y</emphasis><superscript>1</superscript> <!-- 1.10, OpenGL 2.0 -->
113 </entry>
114 <entry>
115 <emphasis>Y</emphasis><superscript>1</superscript> <!-- 1.20, OpenGL 2.1 -->
116 </entry>
117 <entry>
118 <emphasis>Y</emphasis><superscript>1</superscript> <!-- 1.30, OpenGL 3.0 -->
119 </entry>
120 <entry>
121 <emphasis>Y</emphasis><superscript>1</superscript> <!-- 1.40, OpenGL 3.1 -->
122 </entry>
123 <entry>
124 <emphasis>Y</emphasis><superscript>2</superscript> <!-- 1.50, OpenGL 3.2 -->
125 </entry>
126 <entry>
127 <emphasis>Y</emphasis><superscript>2</superscript> <!-- 3.30, OpenGL 3.3 -->
128 </entry>
129 <entry>
130 <emphasis>Y</emphasis> <!-- 4.00, OpenGL 4.0 -->
131 </entry>
132 <entry>
133 <emphasis>Y</emphasis> <!-- 4.10, OpenGL 4.1 -->
134 </entry>
135 </row>
136 </thead>
137 </tgroup>
138 </informaltable>
139 <para>Versions 1.10 to 1.40 - vertex shader only.</para>
140 <para>Versions 1.50 to 3.30 - vertex and geometry shaders only.</para>
141 </refsect1>
142 <refsect1 id="seealso"><title>See Also</title>
143 <para>
144 <citerefentry><refentrytitle>gl_PointSize</refentrytitle></citerefentry>, <citerefentry><refentrytitle>gl_ClipDistance</refentrytitle></citerefentry>
145 </para>
146 </refsect1>
147 <refsect1 id="Copyright"><title>Copyright</title>
148 <para>
149 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
150 This material may be distributed subject to the terms and conditions set forth in
151 the Open Publication License, v 1.0, 8 June 1999.
152 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
153 </para>
154 </refsect1>
155 </refentry>