WebGL - How to use Culling

In this episode, I discuss how to use back-face culling in WebGL and discuss why it's useful.
Concepts:
  • Back-face Culling
  • Determine whether a polygon is front or back facing. Meaning, triangle drawn clockwise or counterclockwise.
  • If culling back-facing polygons (drawn counterclockwise), then it's facing away, and will not drawn.
  • Makes rendering faster.

Resources:
  • https://github.com/davidwparker/programmingtil-webgl/tree/master/0096-culling
  • https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/cullFace
  • https://en.wikipedia.org/wiki/Back-faceculling
© programmingtil.com