I was drawing, simultaneously, a vertex colored cube next to a textured cube, with glDrawArrays()
, and found that with lighting enabled the textured cube gets "slightly brighter".
After some debugging I found that the very first moment that glEnable(GL_COLOR_MATERIAL)
is called, even if glDisable(GL_COLOR_MATERIAL)
is immediately called thereafter, causes a "slightly brighter" effect on textured cube!
Here is the short-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 with a yellow color.
And if glEnable(GL_COLOR_MATERIAL)
is called, even if followed by glDisable(GL_COLOR_MATERIAL)
, the cube is drawn slightly brighter yellow, and I can not switch back to the "initial darker yellow cube color".
Can you please tell me if this is the expected behavior?