PDA

View Full Version : about GL_COLOR_MATERIAL



Sancho
03-29-2001, 03:02 AM
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.

Bob
03-29-2001, 03:47 AM
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.

Sancho
03-29-2001, 03:56 AM
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 ?

kieranatwork
03-29-2001, 04:27 AM
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!

Sancho
03-29-2001, 05:45 AM
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... http://www.opengl.org/discussion_boards/ubb/smile.gif