I was drawing a cube cube at the same time next to a textured cube with glDrawArrays() and found that when the lights are on, the textured cube becomes "a little brighter."
After some debugging, I found that the very first moment that glEnable(GL_COLOR_MATERIAL) , even if glDisable(GL_COLOR_MATERIAL) called after that, causes a “slightly brighter” effect on the textured cube!
Here is a brief description:
glEnable(GL_COLOR_MATERIAL); glDisable(GL_COLOR_MATERIAL); (...) glDrawArrays(GL_QUADS, 0, n);
If glEnable(GL_COLOR_MATERIAL) is not called at all, the cube is drawn in yellow. And if glEnable(GL_COLOR_MATERIAL) , even if followed by glDisable(GL_COLOR_MATERIAL) , the cube is drawn a little brighter than yellow, and I cannot return to the "original color of the darker yellow cube."
Could you tell me if this is the expected behavior?
luiez source share