nickdesaulniers / prims

3D Geometry Primitives for WebGL
Other
42 stars 5 forks source link

back face culling #9

Closed nickdesaulniers closed 10 years ago

nickdesaulniers commented 10 years ago
gl.enable(gl.CULL_FACE)
gl.cullFace(gl.BACK)

not sure if this has performance benefits? @waltermoz

waltermoz commented 10 years ago

It does, but probably not noticeable for these small meshes. It's also a good way to check and see if you got your vertex ordering correct (CCW), as you'll see holes in your mesh.

http://en.wikipedia.org/wiki/Back-face_culling

Like the article mentions if you're doing transparency or have open meshes then you probably want to leave it off.

nickdesaulniers commented 10 years ago

ah thanks, was just thinking that my orderings probably aren't correct

nickdesaulniers commented 10 years ago

Geometries that appear to fail: