Jump to content
  • Advertisement
Sign in to follow this  
arbin

two-side lighting / winding

This topic is 3028 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!