# two-side lighting / winding

## Recommended Posts

arbin    100
Hi, I have a mesh ,not all faces in the mesh are winded consistently. I try to render it in such a way:
glDisable(GL_CULL_FACE);
glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,GL_TRUE);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,matCol);
//render ...(ununiformlly defined winding model)

As I have understood glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,GL_TRUE) reverses backface normals ,but remains the front face normals... But only back faces are lighted.What seems to be the problem? Thank you in advance.

##### Share on other sites
karwosts    840
How are your normals generated, are they all in the right direction, or are they flipped like the winding?

If you have a triangle that the normal is pointed in the opposite direction of the front-face, than I think enabling two-sided lighting will still be incorrect (both faces will now have normals pointed in the opposite direction of their faces).

I think this is how I understand two-sided lighting, but I could be wrong.