<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?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>
                    Specifies the vertex to be used as the source of data for flat shaded varyings.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <span class="emphasis"><em>Flatshading</em></span> a vertex shader varying output means to assign all vetices of the primitive the same value
            for that output. The vertex from which these values is derived is known as the <span class="emphasis"><em>provoking vertex</em></span> and
            <code class="function">glProvokingVertex</code> specifies which vertex is to be used as the source of data for flat shaded varyings.
        </p><p>
            <em class="parameter"><code>provokeMode</code></em> must be either <code class="constant">GL_FIRST_VERTEX_CONVENTION</code> or
            <code class="constant">GL_LAST_VERTEX_CONVENTION</code>, and controls the selection of the vertex whose values are assigned to flatshaded
            varying outputs. The interpretation of these values for the supported primitive types is:
            </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>
                            Primitive Type of Polygon <span class="emphasis"><em>i</em></span>
                            </strong></span></th><th align="left"><span class="bold"><strong>
                            First Vertex Convention
                            </strong></span></th><th align="left"><span class="bold"><strong>
                            Last Vertex Convention
                            </strong></span></th></tr><tr><th align="left">
                                point
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span>
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span>
                            </th></tr><tr><th align="left">
                                independent line
                            </th><th align="left">
                                2<span class="emphasis"><em>i</em></span> - 1
                            </th><th align="left">
                                2<span class="emphasis"><em>i</em></span>
                            </th></tr><tr><th align="left">
                                line loop
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span>
                            </th><th align="left">
                                <p>
                                <span class="emphasis"><em>i</em></span> + 1, if <span class="emphasis"><em>i</em></span> &lt; <span class="emphasis"><em>n</em></span>
                                </p>
                                <p>
                                1, if <span class="emphasis"><em>i</em></span> = <span class="emphasis"><em>n</em></span>
                                </p>
                            </th></tr><tr><th align="left">
                                line strip
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span>
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span> + 1
                            </th></tr><tr><th align="left">
                                independent triangle
                            </th><th align="left">
                                3<span class="emphasis"><em>i</em></span> - 2
                            </th><th align="left">
                                3<span class="emphasis"><em>i</em></span>
                            </th></tr><tr><th align="left">
                                triangle strip
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span>
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span> + 2
                            </th></tr><tr><th align="left">
                                triangle fan
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span> + 1
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span> + 2
                            </th></tr><tr><th align="left">
                                line adjacency
                            </th><th align="left">
                                4<span class="emphasis"><em>i</em></span> - 2
                            </th><th align="left">
                                4<span class="emphasis"><em>i</em></span> - 1
                            </th></tr><tr><th align="left">
                                line strip adjacency
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span> + 1
                            </th><th align="left">
                                <span class="emphasis"><em>i</em></span> + 2
                            </th></tr><tr><th align="left">
                                triangle adjacency
                            </th><th align="left">
                                6<span class="emphasis"><em>i</em></span> - 5
                            </th><th align="left">
                                6<span class="emphasis"><em>i</em></span> - 1
                            </th></tr><tr><th align="left">
                                triangle strip adjacency
                            </th><th align="left">
                                2<span class="emphasis"><em>i</em></span> - 1
                            </th><th align="left">
                                2<span class="emphasis"><em>i</em></span> + 3
                            </th></tr></thead></table></div><p>
        </p><p>
            If a vertex or geometry shader is active, user-defined varying outputs may be flatshaded by using the
            <code class="code">flat</code> qualifier when declaring the output.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glProvokingVertex</code> is available only if the GL version is 3.2 or greater.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>provokeMode</code></em> is not an accepted value.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 2010 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.
            <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
        </p></div></div></body></html>
