PDA

View Full Version : Material problems



Antoche
02-26-2000, 04:19 PM
Well, let's expose the problem :
When i change the material colors (diffuse etc) parameters with glMaterial(), and without enabling GL_COLOR_MATERIAL, i get what i want and everything is beautiful. But when i enable GL_COLOR_MATERIAL to use glColor(), the objetct becomes white. OK, I read the help : the current color (1,1,1,1) is assigned to the current material color (ambient_and_diffuse) that's why all is white. BUT why does glMaterial() not change anything ? I mean, i change the ambient and diffuse colors after this with glMaterial(), but the colors stay the same or are not what i expected to be !
So what's my problem ? Can't glMaterial() and glColor() get together ? What did I miss ? http://www.opengl.org/discussion_boards/ubb/confused.gif

Antoche

Gorg
02-26-2000, 05:04 PM
That's the point of GL_COLOR_MATERIAL :

changing the color of the material with glColor! It saves from expensive state changes from setting the new material color with glMaterial.