be careful of how you are setting the material properties for the surface.
enabling glColorMaterial will take over one of the material properties specified with the constants : GL_AMBIENT , GL_DIFFUSE , GL_SPECULAR & GL_EMISSION. Whenever you call glColor*() it will apply that colour as the material property of the verticies for which it affects.
This does have a couple of uses, for example you could apply seperate grey-scales to various verticies and use it to create fake shadows.
If you want all of your surface to have the same material properties, then I’d suggest not using glColorMaterial.
instead create some material property colour values:
GLfloat ambient[] = { 0.3 , 0.3 , 0.3 , 0.0 };
GLfloat diffuse[] = { 0.6 , 0.6 , 0.6 , 0.6 };
GLfloat specular[] = { 1.0 , 1.0 , 1.0 , 1.0 };
and when drawing use something like :
glPushMatrix();
glMaterialfv( GL_FRONT , GL_AMBIENT , ambient );
glMaterialfv( GL_FRONT , GL_DIFFUSE , diffuse );
glMaterialfv( GL_FRONT , GL_SPECULAR , specular );
drawObject();
glPopMatrix();
You could also compile a set of glMaterial*() calls as a display list. That way you could create a simple material library, and call the display list before drawing the object. Hope that’s of some use.
[This message has been edited by Rob The Bloke (edited 01-22-2001).]