about GL_COLOR_MATERIAL

Sorry for my eventualy stupid question, but
disabling lighting with glDisable(GL_LIGHTING), cause the GL_COLOR_MATERIAL takes no effect ? So, is
{

glDisable(GL_LIGHTING);

}

equivalent to
{

glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);

}
?

Thanks.

GL_COLOR_MATERIAL is used to set material color (ambient, diffuse and/or specular) with the glColor-function or with vertex arrays, and materials is only used with lighting.

Originally posted by Bob:
GL_COLOR_MATERIAL is used to set material color (ambient, diffuse and/or specular) with the glColor-function or with vertex arrays, and materials is only used with lighting.

I know that, but is colorMaterial tracking activated even if lighing is disable ?

Give it a try!
Enable lighting,
set your diffuse material property to green,
Draw a polygon.
disable lighting,
enable colour material and track the diffuse property,
change your colour to red, using glColor,
Enable Lighting,
Draw a polygon.

If your second polygon is drawn in green, then disable lighting does indeed disable colour material, but if your second polygon is drawn in red, then it doesn’t.

It’s not hard to find answers if you do a bit of experimentation, you know!

Originally posted by kieranatwork:
Give it a try!
It’s not hard to find answers if you do a bit of experimentation, you know!

I know and I’m sorry…