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_FrontFacing">\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_FrontFacing</refentrytitle>\r | |
13 | <manvolnum>3G</manvolnum>\r | |
14 | </refmeta>\r | |
15 | <refnamediv>\r | |
16 | <refname>gl_FrontFacing</refname>\r | |
17 | <refpurpose>indicates whether a primitive is front or back facing</refpurpose>\r | |
18 | </refnamediv>\r | |
19 | <refsynopsisdiv><title>Declaration</title>\r | |
20 | <funcsynopsis>\r | |
21 | <function>in bool gl_FrontFacing;</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_FrontFacing</function> is an input variable\r | |
27 | whose value is <function>true</function> if the fragment belongs to a front-facing primitive and\r | |
28 | false otherwise. The determination of whether a triangle primitive is front-facing is made by\r | |
29 | examining the sign of the area of the triangle, including a possible reversal of this sign\r | |
30 | as controlled by <function>glFrontFace</function>. One way to compute this area is:\r | |
31 | </para>\r | |
32 | <para>\r | |
33 | <inlineequation><mml:math>\r | |
34 | <mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac>\r | |
35 | <mml:msubsup><mml:mo>∑</mml:mo><mml:mrow>\r | |
36 | <mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn>\r | |
37 | </mml:mrow>\r | |
38 | <mml:mrow>\r | |
39 | <mml:mi>n</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn>\r | |
40 | </mml:mrow></mml:msubsup>\r | |
41 | <mml:msubsup><mml:mi>x</mml:mi><mml:mrow>w</mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msubsup>\r | |
42 | <mml:msubsup><mml:mi>y</mml:mi><mml:mrow>w</mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msubsup>\r | |
43 | <mml:mo>-</mml:mo>\r | |
44 | <mml:msubsup><mml:mi>x</mml:mi><mml:mrow>w</mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msubsup>\r | |
45 | <mml:msubsup><mml:mi>y</mml:mi><mml:mrow>w</mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msubsup>\r | |
46 | </mml:math></inlineequation>\r | |
47 | </para>\r | |
48 | <para>\r | |
49 | where <inlineequation><mml:math><mml:msubsup><mml:mi>x</mml:mi><mml:mrow>w</mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msubsup></mml:math></inlineequation> and\r | |
50 | <inlineequation><mml:math><mml:msubsup><mml:mi>y</mml:mi><mml:mrow>w</mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msubsup></mml:math></inlineequation> are\r | |
51 | the x and y window coordinates of the <emphasis>i</emphasis>th vertex of the n-vertex polygon.\r | |
52 | </para>\r | |
53 | </refsect1>\r | |
54 | <refsect1 id="versions"><title>Version Support</title>\r | |
55 | <informaltable frame="topbot">\r | |
56 | <tgroup cols="3" align="left">\r | |
57 | <colspec colwidth="1.1*" />\r | |
58 | <colspec colwidth="1*" align="center" />\r | |
59 | <colspec colwidth="1*" align="center" />\r | |
60 | <colspec colwidth="1*" align="center" />\r | |
61 | <colspec colwidth="1*" align="center" />\r | |
62 | <colspec colwidth="1*" align="center" />\r | |
63 | <colspec colwidth="1*" align="center" />\r | |
64 | <colspec colwidth="1*" align="center" />\r | |
65 | <colspec colwidth="1*" align="center" />\r | |
66 | <thead>\r | |
67 | <row>\r | |
68 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
69 | Variable\r | |
70 | </emphasis></entry>\r | |
71 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
72 | Version 1.10\r | |
73 | </emphasis></entry>\r | |
74 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
75 | Version 1.20\r | |
76 | </emphasis></entry>\r | |
77 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
78 | Version 1.30\r | |
79 | </emphasis></entry>\r | |
80 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
81 | Version 1.40\r | |
82 | </emphasis></entry>\r | |
83 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
84 | Version 1.50\r | |
85 | </emphasis></entry>\r | |
86 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
87 | Version 3.30\r | |
88 | </emphasis></entry>\r | |
89 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
90 | Version 4.00\r | |
91 | </emphasis></entry>\r | |
92 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
93 | Version 4.10\r | |
94 | </emphasis></entry>\r | |
95 | </row>\r | |
96 | <row>\r | |
97 | <entry>\r | |
98 | gl_FrontFacing\r | |
99 | </entry>\r | |
100 | <entry>\r | |
101 | <emphasis>Y</emphasis> <!-- 1.10, OpenGL 2.0 -->\r | |
102 | </entry>\r | |
103 | <entry>\r | |
104 | <emphasis>Y</emphasis> <!-- 1.20, OpenGL 2.1 -->\r | |
105 | </entry>\r | |
106 | <entry>\r | |
107 | <emphasis>Y</emphasis> <!-- 1.30, OpenGL 3.0 -->\r | |
108 | </entry>\r | |
109 | <entry>\r | |
110 | <emphasis>Y</emphasis> <!-- 1.40, OpenGL 3.1 -->\r | |
111 | </entry>\r | |
112 | <entry>\r | |
113 | <emphasis>Y</emphasis> <!-- 1.50, OpenGL 3.2 -->\r | |
114 | </entry>\r | |
115 | <entry>\r | |
116 | <emphasis>Y</emphasis> <!-- 3.30, OpenGL 3.3 -->\r | |
117 | </entry>\r | |
118 | <entry>\r | |
119 | <emphasis>Y</emphasis> <!-- 4.00, OpenGL 4.0 -->\r | |
120 | </entry>\r | |
121 | <entry>\r | |
122 | <emphasis>Y</emphasis> <!-- 4.10, OpenGL 4.1 -->\r | |
123 | </entry>\r | |
124 | </row>\r | |
125 | </thead>\r | |
126 | </tgroup>\r | |
127 | </informaltable>\r | |
128 | </refsect1>\r | |
129 | <refsect1 id="seealso"><title>See Also</title>\r | |
130 | <para>\r | |
131 | <citerefentry><refentrytitle>gl_FragCoord</refentrytitle></citerefentry>\r | |
132 | </para>\r | |
133 | </refsect1>\r | |
134 | <refsect1 id="Copyright"><title>Copyright</title>\r | |
135 | <para>\r | |
136 | Copyright <trademark class="copyright"></trademark> 2011 Khronos Group. \r | |
137 | This material may be distributed subject to the terms and conditions set forth in \r | |
138 | the Open Publication License, v 1.0, 8 June 1999.\r | |
139 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r | |
140 | </para>\r | |
141 | </refsect1>\r | |
142 | </refentry>\r |