WebGL
Khronos
 

WebGL WEBGL_provoking_vertex Extension Specification

Name

WEBGL_provoking_vertex

Contact

WebGL working group (public_webgl 'at' khronos.org)

Contributors

Kelsey Gilbert (Mozilla)

Members of the WebGL working group

Version

Last modified date: January 26, 2023
Revision: 5

Number

WebGL extension #48

Dependencies

Written against the WebGL API 2.0 specification.

Overview

This extension exposes the ANGLE_provoking_vertex functionality to WebGL.

The following WebGL-specific behavioral changes apply:

Consult the above extension for documentation, issues and new functions and enumerants.

When this extension is enabled:

IDL

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WEBGL_provoking_vertex {
    const GLenum FIRST_VERTEX_CONVENTION_WEBGL = 0x8E4D;
    const GLenum LAST_VERTEX_CONVENTION_WEBGL  = 0x8E4E; // default
    const GLenum PROVOKING_VERTEX_WEBGL        = 0x8E4F;

    undefined provokingVertexWEBGL(GLenum provokeMode);
};
  

Sample Code

    function optimizeAssumingFlatsHaveSameFirstAndLastData(gl) {
      const epv = gl.getExtension('WEBGL_provoking_vertex');
      if (epv) {
        epv.provokingVertexWEBGL(epv.FIRST_VERTEX_CONVENTION_WEBGL);
      }
    }
    

Revision History

Revision 1, 2022/06/23

Revision 2, 2022/07/01

Revision 3, 2022/11/01

Revision 4, 2022/11/23

Revision 5, 2023/01/26