adrien
09-20-2005, 12:46 AM
hello,
i'm using the followinf commands to specify the action of the next glColors operations :
float theBackColor[4]; theBackColor[0] = 0.f; theBackColor[1] = 0.f; theBackColor[2] = 0.f; theBackColor[3] = 1.f; glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, theBackColor );
glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, theBackColor); glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, theBackColor); glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, theBackColor);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
It works on some video cards, but on some others, a previously used color is also used.
I found that specifying glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_D IFFUSE); solves the problem.
And also, if I call glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE); before calling glEnable(GL_COLOR_MATERIAL);, the result is correct.
Is is something known that one must call glColorMaterial BEFORE enabling GL_COLOR_MATERIAL ?
And why is-it card dependant ?
thanks much
Adrien
i'm using the followinf commands to specify the action of the next glColors operations :
float theBackColor[4]; theBackColor[0] = 0.f; theBackColor[1] = 0.f; theBackColor[2] = 0.f; theBackColor[3] = 1.f; glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, theBackColor );
glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, theBackColor); glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, theBackColor); glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, theBackColor);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
It works on some video cards, but on some others, a previously used color is also used.
I found that specifying glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_D IFFUSE); solves the problem.
And also, if I call glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE); before calling glEnable(GL_COLOR_MATERIAL);, the result is correct.
Is is something known that one must call glColorMaterial BEFORE enabling GL_COLOR_MATERIAL ?
And why is-it card dependant ?
thanks much
Adrien