Sign in to follow this  
SAE Superman

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this