Name | |

ANGLE_provoking_vertex | |

Name Strings | |

GL_ANGLE_provoking_vertex | |

Status | |

Complete | |

Version | |

Last Modified Date: Nov 1, 2022 | |

Author Revision: 1 | |

Number | |

OpenGL ES Extension XX | |

Dependencies | |

OpenGL ES 3.0 is required. | |

This extension is written against the OpenGL ES 3.0 specification. | |

OES_geometry_shader and EXT_geometry_shader interact with this extension. | |

Overview | |

This extension provides an alternative provoking vertex convention | |

for rendering lines and triangles. | |

The provoking vertex of a primitive is the vertex that determines the | |

constant output values when "flat" interpolation qualifier is used. | |

In OpenGL ES, the provoking vertex for triangle, line, and (trivially) | |

point primitives is the last vertex used to assemble the primitive. | |

Alternatively the provoking vertex could be the first vertex of | |

the primitive. Other APIs have adopted the "first vertex of the | |

primitive" convention to determine the provoking vertex. | |

The motivation for this extension is to allow convention-agnostic | |

applications to have better performance when running on top of layered | |

implementations of OpenGL ES (such as ANGLE) that use native APIs with | |

the "first vertex of the primitive" provoking vertex convention. | |

New Procedures and Functions | |

void ProvokingVertexANGLE(enum provokeMode); | |

New Tokens | |

Accepted by the <provokeMode> parameter of ProvokingVertex: | |

FIRST_VERTEX_CONVENTION_ANGLE 0x8E4D | |

LAST_VERTEX_CONVENTION_ANGLE 0x8E4E | |

Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, | |

GetFloatv, and GetDoublev: | |

PROVOKING_VERTEX_ANGLE 0x8E4F | |

Additions to Chapter 2 of the OpenGL ES 3.0 Specification (OpenGL ES Operation) | |

Modify Section 2.17 "Flatshading" | |

(replace Table 2.12) | |

First vertex Last vertex | |

Primitive type of polygon i convention convention | |

=========================== ============ ============= | |

point i i | |

independent line 2i-1 2i | |

line loop i i+1, if i<n | |

1, if i==n | |

line strip i i+1 | |

independent triangle 3i-2 3i | |

triangle strip i i+2 | |

triangle fan i+1 i+2 | |

line adjacency 4i-2 4i-1 | |

line strip adjacency i+1 i+2 | |

triangle adjacency 6i-5 6i-1 | |

triangle strip adjacency 2i-1 2i+3 | |

Table 2.12: Provoking vertex selection. The output values used for | |

flatshading the <i>th primitive generated by drawing commands with the | |

indicated primitive type are derived from the corresponding values of | |

the vertex whose index is shown in the table. Vertices are numbered 1 | |

through n, where n is the number of vertices drawn. | |

(add after the second paragraph) | |

The provoking vertex is controlled with the command | |

void ProvokingVertexANGLE(enum provokeMode); | |

<provokeMode> must be either FIRST_VERTEX_CONVENTION_ANGLE or | |

LAST_VERTEX_CONVENTION_ANGLE, and controls selection of the vertex whose | |

values are assigned to varying outputs, as shown in Table 2.12. | |

The state required for flatshading is one bit for the provoking vertex | |

mode. The initial value of the provoking vertex mode is | |

LAST_VERTEX_CONVENTION_ANGLE. | |

Dependencies on OES_geometry_shader, EXT_geometry_shader, and/or the geometry | |

shader functionality integrated into the core by OpenGL ES 3.2: | |

If none of OES_geometry_shader, EXT_geometry_shader, or OpenGL ES 3.2 | |

are supported: | |

* ignore the rows of table 2.12 for line adjacency, line strip | |

adjacency, triangle adjacency, and triangle strip adjacency. | |

Errors | |

INVALID_ENUM is generated when ProvokingVertexANGLE is called with a | |

<provokeMode> that is not either FIRST_VERTEX_CONVENTION_ANGLE or | |

LAST_VERTEX_CONVENTION_ANGLE. | |

New State | |

(add a new table "Coloring" after the table 6.5) | |

Get Value Type Get Command Initial Value Description Sec | |

---------------- ---- ----------- ---------------------------- ---------------- ---- | |

PROVOKING_VERTEX_ANGLE Z2 GetIntegerv LAST_VERTEX_CONVENTION_ANGLE Provoking vertex 2.17 | |

convention | |

Revision History | |

11/1/2022 First revision |