Depth, blending & cullingGL 1.0
glFrontFace
Defines which vertex order (winding) counts as a front-facing triangle.
Signature
void glFrontFace(GLenum mode);
How it works
After projection, a triangle's vertices appear on screen either counter-clockwise or clockwise. OpenGL uses this to tell front from back. The default is counter-clockwise (GL_CCW) — the convention of most modeling tools and of glTF.
Parameters
modeGLenum
Winding of front faces.
Common values
- GL_CCW
- Counter-clockwise (default).
- GL_CW
- Clockwise.
Tips & pitfalls
A model that looks inside-out with culling on usually has the opposite winding — flip it here or in the exporter.
Example
example.cpp
1glFrontFace(GL_CCW);