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_SamplePosition">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>gl_SamplePosition
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>gl_SamplePosition
</refname>
17 <refpurpose>contains the location of the current sample within the current fragment
</refpurpose>
19 <refsynopsisdiv><title>Declaration
</title>
21 <function>in vec2 gl_SamplePosition;
</function>
24 <refsect1 id=
"description"><title>Description
</title>
26 <function>gl_SamplePosition
</function> is a fragment language input variable that contains
27 the location within a fragment of the sample currently being processed. The x and y components
28 of
<function>gl_SamplePosition
</function> contain the sub-pixel coordinate of the current
29 sample and will have values in the range
0.0 to
1.0. The sub-pixel coordinates of the center
30 of the pixel are always (
0.5,
0.5). Any static use of
<function>gl_SamplePosition
</function>
31 causes the entire fragment shader to be evaluated per-sample rather than per-fragment. When rendering
32 to a non-multisample buffer, or if multisample rasterization is disabled,
<function>gl_SamplePosition
</function>
36 <refsect1 id=
"versions"><title>Version Support
</title>
37 <informaltable frame=
"topbot">
38 <tgroup cols=
"3" align=
"left">
39 <colspec colwidth=
"1.1*" />
40 <colspec colwidth=
"1*" align=
"center" />
41 <colspec colwidth=
"1*" align=
"center" />
42 <colspec colwidth=
"1*" align=
"center" />
43 <colspec colwidth=
"1*" align=
"center" />
44 <colspec colwidth=
"1*" align=
"center" />
45 <colspec colwidth=
"1*" align=
"center" />
46 <colspec colwidth=
"1*" align=
"center" />
47 <colspec colwidth=
"1*" align=
"center" />
50 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
53 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
56 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
59 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
62 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
65 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
68 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
71 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
74 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
83 <emphasis>-
</emphasis> <!-- 1.10, OpenGL 2.0 -->
86 <emphasis>-
</emphasis> <!-- 1.20, OpenGL 2.1 -->
89 <emphasis>-
</emphasis> <!-- 1.30, OpenGL 3.0 -->
92 <emphasis>-
</emphasis> <!-- 1.40, OpenGL 3.1 -->
95 <emphasis>-
</emphasis> <!-- 1.50, OpenGL 3.2 -->
98 <emphasis>-
</emphasis> <!-- 3.30, OpenGL 3.3 -->
101 <emphasis>Y
</emphasis> <!-- 4.00, OpenGL 4.0 -->
104 <emphasis>Y
</emphasis> <!-- 4.10, OpenGL 4.1 -->
111 <refsect1 id=
"seealso"><title>See Also
</title>
113 <citerefentry><refentrytitle>gl_SampleID
</refentrytitle></citerefentry>,
114 <citerefentry><refentrytitle>gl_SampleMask
</refentrytitle></citerefentry>,
115 <citerefentry><refentrytitle>gl_FragCoord
</refentrytitle></citerefentry>
118 <refsect1 id=
"Copyright"><title>Copyright
</title>
120 Copyright
<trademark class=
"copyright"></trademark> 2011 Khronos Group.
121 This material may be distributed subject to the terms and conditions set forth in
122 the Open Publication License, v
1.0,
8 June
1999.
123 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.