Jump to content
  • Advertisement
Sign in to follow this  
SAE Superman

OpenGL One polygon, different color per face side...

This topic is 4457 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

I've never had this situation come up until now... I have a polygon that I want to have the front face be one color and the back face be a different color. Is there an easy way to do this in OpenGL? Thanks in advance...

Share this post


Link to post
Share on other sites
Advertisement
Disable backface culling glDisable(GL_CULL_FACE), then enable two-sided lighting glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1). Once that's done, you can specific separate materials for the front and back face of a polygon.

Alternatively you can just render two polygons with opposite vertex winding (thus a front and a back face), in different colors, and let backface culling remove the one that shouldn't be visible.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!