File: gl_FragCoord.xml

package info (click to toggle)
khronos-opengl-man4 1.0~svn33624-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 6,344 kB
  • sloc: xml: 93,066; makefile: 730; python: 627; sh: 50; php: 4
file content (84 lines) | stat: -rw-r--r-- 4,621 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>

<!-- Converted by db4-upgrade version 1.1 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="gl_FragCoord">
    <info>
        <copyright>
            <year>2011-2014</year>
            <holder>Khronos Group</holder>
        </copyright>
    </info>
    <refmeta>
        <refentrytitle>gl_FragCoord</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>gl_FragCoord</refname>
        <refpurpose>contains the window-relative coordinates of the current fragment</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Declaration</title>
        <fieldsynopsis>
            <modifier>in</modifier>
            <type>vec4</type>
            <varname>gl_FragCoord</varname>
        </fieldsynopsis>
    </refsynopsisdiv>
    <refsect1 xml:id="description"><title>Description</title>
        <para>
            Available only in the fragment language, <varname>gl_FragCoord</varname> is an input variable that contains the
            window relative coordinate (x, y, z, 1/w) values for the fragment. If multi-sampling,
            this value can be for any location within the pixel, or one of the fragment samples.
            This value is the result of fixed functionality that interpolates primitives after vertex
            processing to generate fragments. The z component is the depth value that would be used for the
            fragment's depth if no shader contained any writes to <citerefentry><refentrytitle>gl_FragDepth</refentrytitle></citerefentry>.
        </para>
        <para>
            <varname>gl_FragCoord</varname> may be redeclared with the additional layout qualifier identifiers
            <function>origin_upper_left</function> or <function>pixel_center_integer</function>. By
            default, <varname>gl_FragCoord</varname> assumes a lower-left origin for window coordinates
            and assumes pixel centers are located at half-pixel centers. For example, the (x, y) location
            (0.5, 0.5) is returned for the lower-left-most pixel in a window. The origin of
            <varname>gl_FragCoord</varname> may be changed by redeclaring <varname>gl_FragCoord</varname>
            with the <function>origin_upper_left</function> identifier. The values returned can also be
            shifted by half a pixel in both x and y by <function>pixel_center_integer</function> so it
            appears the pixels are centered at whole number pixel offsets. This moves the (x, y) value returned by
            <varname>gl_FragCoord</varname> of (0.5, 0.5) by default to (0.0, 0.0) with
            <function>pixel_center_integer</function>.
        </para>
        <para>
            If <varname>gl_FragCoord</varname> is redeclared in any fragment shader in a program, it must be redeclared
            in all fragment shaders in that program that have static use of <varname>gl_FragCoord</varname>. Redeclaring
            <varname>gl_FragCoord</varname> with any accepted qualifier affects only <varname>gl_FragCoord.x</varname>
            and <varname>gl_FragCoord.y</varname>. It has no affect on rasterization, transformation or any other part
            of the OpenGL pipline or language features.
        </para>
    </refsect1>
    <refsect1 xml:id="versions"><title>Version Support</title>
        <informaltable>
            <tgroup cols="13" align="left">
                <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="varhead.xml" xpointer="xpointer(/*/*)"/>
                <tbody>
                    <row>
                        <entry>gl_FragCoord</entry>
                        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="version.xml" xpointer="xpointer(/*/*[@role='11']/*)"/>
                    </row>
                </tbody>
            </tgroup>
        </informaltable>
    </refsect1>
    <refsect1 xml:id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>gl_FragCoord</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 xml:id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"/> 2011-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.
            <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://opencontent.org/openpub/">http://opencontent.org/openpub/</link>.
        </para>
    </refsect1>
</refentry>