bb6ce197db0d0b87008e8689b79d12d9ac7d4d6b
[clinton/guile-figl.git] / upstream-man-pages / man3 / xhtml / glProvokingVertex.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
3 <!-- saved from url=(0013)about:internet -->
4 <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glProvokingVertex</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div class="refentry" title="glProvokingVertex"><a id="glProvokingVertex"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glProvokingVertex — specifiy the vertex to be used as the source of data for flat shaded varyings</p></div><div class="refsynopsisdiv" title="C Specification"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glProvokingVertex</b>(</code></td><td>GLenum <var class="pdparam">provokeMode</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Parameters"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>provokeMode</code></em></span></dt><dd><p>
5 Specifies the vertex to be used as the source of data for flat shaded varyings.
6 </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="description"></a><h2>Description</h2><p>
7 <span class="emphasis"><em>Flatshading</em></span> a vertex shader varying output means to assign all vetices of the primitive the same value
8 for that output. The vertex from which these values is derived is known as the <span class="emphasis"><em>provoking vertex</em></span> and
9 <code class="function">glProvokingVertex</code> specifies which vertex is to be used as the source of data for flat shaded varyings.
10 </p><p>
11 <em class="parameter"><code>provokeMode</code></em> must be either <code class="constant">GL_FIRST_VERTEX_CONVENTION</code> or
12 <code class="constant">GL_LAST_VERTEX_CONVENTION</code>, and controls the selection of the vertex whose values are assigned to flatshaded
13 varying outputs. The interpretation of these values for the supported primitive types is:
14 </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
15 Primitive Type of Polygon <span class="emphasis"><em>i</em></span>
16 </strong></span></th><th align="left"><span class="bold"><strong>
17 First Vertex Convention
18 </strong></span></th><th align="left"><span class="bold"><strong>
19 Last Vertex Convention
20 </strong></span></th></tr><tr><th align="left">
21 point
22 </th><th align="left">
23 <span class="emphasis"><em>i</em></span>
24 </th><th align="left">
25 <span class="emphasis"><em>i</em></span>
26 </th></tr><tr><th align="left">
27 independent line
28 </th><th align="left">
29 2<span class="emphasis"><em>i</em></span> - 1
30 </th><th align="left">
31 2<span class="emphasis"><em>i</em></span>
32 </th></tr><tr><th align="left">
33 line loop
34 </th><th align="left">
35 <span class="emphasis"><em>i</em></span>
36 </th><th align="left">
37 <p>
38 <span class="emphasis"><em>i</em></span> + 1, if <span class="emphasis"><em>i</em></span> &lt; <span class="emphasis"><em>n</em></span>
39 </p>
40 <p>
41 1, if <span class="emphasis"><em>i</em></span> = <span class="emphasis"><em>n</em></span>
42 </p>
43 </th></tr><tr><th align="left">
44 line strip
45 </th><th align="left">
46 <span class="emphasis"><em>i</em></span>
47 </th><th align="left">
48 <span class="emphasis"><em>i</em></span> + 1
49 </th></tr><tr><th align="left">
50 independent triangle
51 </th><th align="left">
52 3<span class="emphasis"><em>i</em></span> - 2
53 </th><th align="left">
54 3<span class="emphasis"><em>i</em></span>
55 </th></tr><tr><th align="left">
56 triangle strip
57 </th><th align="left">
58 <span class="emphasis"><em>i</em></span>
59 </th><th align="left">
60 <span class="emphasis"><em>i</em></span> + 2
61 </th></tr><tr><th align="left">
62 triangle fan
63 </th><th align="left">
64 <span class="emphasis"><em>i</em></span> + 1
65 </th><th align="left">
66 <span class="emphasis"><em>i</em></span> + 2
67 </th></tr><tr><th align="left">
68 line adjacency
69 </th><th align="left">
70 4<span class="emphasis"><em>i</em></span> - 2
71 </th><th align="left">
72 4<span class="emphasis"><em>i</em></span> - 1
73 </th></tr><tr><th align="left">
74 line strip adjacency
75 </th><th align="left">
76 <span class="emphasis"><em>i</em></span> + 1
77 </th><th align="left">
78 <span class="emphasis"><em>i</em></span> + 2
79 </th></tr><tr><th align="left">
80 triangle adjacency
81 </th><th align="left">
82 6<span class="emphasis"><em>i</em></span> - 5
83 </th><th align="left">
84 6<span class="emphasis"><em>i</em></span> - 1
85 </th></tr><tr><th align="left">
86 triangle strip adjacency
87 </th><th align="left">
88 2<span class="emphasis"><em>i</em></span> - 1
89 </th><th align="left">
90 2<span class="emphasis"><em>i</em></span> + 3
91 </th></tr></thead></table></div><p>
92 </p><p>
93 If a vertex or geometry shader is active, user-defined varying outputs may be flatshaded by using the
94 <code class="code">flat</code> qualifier when declaring the output.
95 </p></div><div class="refsect1" title="Notes"><a id="notes"></a><h2>Notes</h2><p>
96 <code class="function">glProvokingVertex</code> is available only if the GL version is 3.2 or greater.
97 </p></div><div class="refsect1" title="Errors"><a id="errors"></a><h2>Errors</h2><p>
98 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>provokeMode</code></em> is not an accepted value.
99 </p></div><div class="refsect1" title="Copyright"><a id="Copyright"></a><h2>Copyright</h2><p>
100 Copyright <span class="trademark"></span>© 2010 Khronos Group.
101 This material may be distributed subject to the terms and conditions set forth in
102 the Open Publication License, v 1.0, 8 June 1999.
103 <a class="ulink" href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
104 </p></div></div></body></html>