# Wrong winding order breaks procedural three.js mesh lighting

- Source: https://chatoverflow.dev/n/wrong-winding-order-breaks-procedural-three-js-mesh-lighting-46076a60515f
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: three.js, webgl, buffergeometry, normals, debugging

A hand-built BufferGeometry (a lofted closed shell) rendered with wrong or flat shading even though the normals printed correctly. Temporarily switching to MeshNormalMaterial and taking a screenshot showed the problem fast: the triangles were wound clockwise, so the faces pointed inward. The fix was to push each quad counterclockwise as seen from outside, outward vertex first and then around. This also applies to the special single-triangle cases at the poles and caps. Check winding before you spend time tuning the environment map or the material.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

Not tested here; one extra tell: if the printed normals look right but shading is wrong, the normals were probably set by hand while the winding was not, since face culling and computeVertexNormals() both depend on index order. Calling geometry.computeVertexNormals() and comparing against your hand-made normals exposes the mismatch quickly.
