Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?>\r |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r | |
4 | <refentry id="gl_FragCoord">\r | |
5 | <refmeta>\r | |
6 | <refmetainfo>\r | |
7 | <copyright>\r | |
8 | <year>2011</year>\r | |
9 | <holder>Khronos Group</holder>\r | |
10 | </copyright>\r | |
11 | </refmetainfo>\r | |
12 | <refentrytitle>gl_FragCoord</refentrytitle>\r | |
13 | <manvolnum>3G</manvolnum>\r | |
14 | </refmeta>\r | |
15 | <refnamediv>\r | |
16 | <refname>gl_FragCoord</refname>\r | |
17 | <refpurpose>contains the window-relative coordinates of the current fragment</refpurpose>\r | |
18 | </refnamediv>\r | |
19 | <refsynopsisdiv><title>Declaration</title>\r | |
20 | <funcsynopsis>\r | |
21 | <function>in vec4 gl_FragCoord;</function>\r | |
22 | </funcsynopsis>\r | |
23 | </refsynopsisdiv>\r | |
24 | <refsect1 id="description"><title>Description</title>\r | |
25 | <para>\r | |
26 | Available only in the fragment language, <function>gl_FragCoord</function> is an input variable that contains the\r | |
27 | window relative coordinate (x, y, z, 1/w) values for the fragment. If multi-sampling,\r | |
28 | this value can be for any location within the pixel, or one of the fragment samples.\r | |
29 | This value is the result of fixed functionality that interpolates primitives after vertex\r | |
30 | processing to generate fragments. The z component is the depth value that would be used for the\r | |
31 | fragment's depth if no shader contained any writes to <citerefentry><refentrytitle>gl_FragDepth</refentrytitle></citerefentry>.\r | |
32 | </para>\r | |
33 | <para>\r | |
34 | <function>gl_FragCoord</function> may be redeclared with the additional layout qualifier identifiers\r | |
35 | <function>origin_upper_left</function> or <function>pixel_center_integer</function>. By\r | |
36 | default, <function>gl_FragCoord</function> assumes a lower-left origin for window coordinates\r | |
37 | and assumes pixel centers are located at half-pixel centers. For example, the (x, y) location\r | |
38 | (0.5, 0.5) is returned for the lower-left-most pixel in a window. The origin of\r | |
39 | <function>gl_FragCoord</function> may be changed by redeclaring <function>gl_FragCoord</function>\r | |
40 | with the <function>origin_upper_left</function> identifier. The values returned can also be\r | |
41 | shifted by half a pixel in both x and y by <function>pixel_center_integer</function> so it\r | |
42 | appears the pixels are centered at whole number pixel offsets. This moves the (x, y) value returned by\r | |
43 | <function>gl_FragCoord</function> of (0.5, 0.5) by default to (0.0, 0.0) with\r | |
44 | <function>pixel_center_integer</function>.\r | |
45 | </para>\r | |
46 | <para>\r | |
47 | If <function>gl_FragCoord</function> is redeclared in any fragment shader in a program, it must be redeclared\r | |
48 | in all fragment shaders in that program that have static use of <function>gl_FragCoord</function>. Redeclaring\r | |
49 | <function>gl_FragCoord</function> with any accepted qualifier affects only <function>gl_FragCoord.x</function>\r | |
50 | and <function>gl_FragCoord.y</function>. It has no affect on rasterization, transformation or any other part\r | |
51 | of the OpenGL pipline or language features.\r | |
52 | </para>\r | |
53 | </refsect1>\r | |
54 | <refsect1 id="versions"><title>Version Support</title>\r | |
55 | <informaltable frame="topbot">\r | |
56 | #VARTABLECOLS#\r | |
57 | <thead>\r | |
58 | #VARTABLEHEADER#\r | |
59 | <row>\r | |
60 | <entry>gl_ClipDistance</entry>#newin11#\r | |
61 | </row>\r | |
62 | </thead>\r | |
63 | </tgroup>\r | |
64 | </informaltable>\r | |
65 | </refsect1>\r | |
66 | <refsect1 id="seealso"><title>See Also</title>\r | |
67 | <para>\r | |
68 | <citerefentry><refentrytitle>gl_FragCoord</refentrytitle></citerefentry>\r | |
69 | </para>\r | |
70 | </refsect1>\r | |
71 | <refsect1 id="Copyright"><title>Copyright</title>\r | |
72 | <para>\r | |
73 | Copyright <trademark class="copyright"></trademark> 2011 Khronos Group. \r | |
74 | This material may be distributed subject to the terms and conditions set forth in \r | |
75 | the Open Publication License, v 1.0, 8 June 1999.\r | |
76 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r | |
77 | </para>\r | |
78 | </refsect1>\r | |
79 | </refentry>\r |