One polygon, different color per face side...
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...
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement