A question about ColorMaterial

hi all:
for OpenGL ES

  1. if i enable Color material and enable Color array(i also feed color data into color array).
    does the material come from color array??

2)if i enable Color material and enable Color array but i also call glColor*
where is the material come from? color array? or the color form glColor*?

  1. Yes, the ambient and diffuse colors of the material will be replaced by the color from the color array.

  2. Vertex arrays override current vertex attributes, so the color value is taken from the array. That is why they need to be enabled.

hi Xmas:
thanks for your reply,

for (1)
if colormaterial enable, and the color array enable too,
each vertex has it’s own material parameter?
3 vertices share one material parameter( and which one? )

Each vertex has its own ambient and diffuse colors. However, flat shading - which you’re likely referring to - can still be independently enabled using glShadeModel.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.