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 - OpenGL
4 Reference Pages
</title><meta name=
"generator" content=
"DocBook XSL Stylesheets V1.69.1" /></head><body><div class=
"refentry" lang=
"en" xml:
lang=
"en"><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"><h2>C Specification
</h2><div class=
"funcsynopsis"><p><code class=
"funcdef">void
<b class=
"fsfunc">glProvokingVertex
</b>(
</code>GLenum
<var class=
"pdparam">provokeMode
</var><code>)
</code>;
</p></div></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><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" lang=
"en" xml:
lang=
"en"><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.
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">
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">
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">
34 </th><th align=
"left">
35 <span class=
"emphasis"><em>i
</em></span>
36 </th><th align=
"left">
38 <span class=
"emphasis"><em>i
</em></span> +
1, if
<span class=
"emphasis"><em>i
</em></span> < <span class=
"emphasis"><em>n
</em></span>
41 1, if
<span class=
"emphasis"><em>i
</em></span> =
<span class=
"emphasis"><em>n
</em></span>
43 </th></tr><tr><th align=
"left">
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">
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">
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">
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">
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">
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">
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>
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" lang=
"en" xml:
lang=
"en"><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" lang=
"en" xml:
lang=
"en"><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" lang=
"en" xml:
lang=
"en"><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 href=
"http://opencontent.org/openpub/" target=
"_top">http://opencontent.org/openpub/
</a>.
104 </p></div></div></body></html>