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