WebGLRenderingContext.frontFace()

The WebGLRenderingContext.frontFace() method of the WebGL API specifies whether polygons are front- or back-facing by setting a winding orientation.

Syntax

void gl.frontFace(mode);

Parameters

mode
A GLenum type winding orientation. The default value is gl.CCW. Possible values:
  • gl.CW: Clock-wise winding.
  • gl.CCW: Counter-clock-wise winding.

Return value

None.

Examples

gl.frontFace(gl.CW);

Specifications

Specification Status Comment
WebGL 1.0
The definition of 'frontFace' in that specification.
Recommendation Initial definition.
OpenGL ES 2.0
The definition of 'glFrontFace' in that specification.
Standard Man page of the OpenGL API.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
frontFaceChrome Full support 9Edge Full support 12Firefox Full support 4IE Full support 11Opera Full support 12Safari Full support 5.1WebView Android Full support YesChrome Android Full support 25Firefox Android Full support YesOpera Android Full support 12Safari iOS Full support 8Samsung Internet Android Full support 1.5

Legend

Full support
Full support

See also