View Full Version : glColorMaterial().

04-29-2004, 12:52 AM
Hi All,
I want to know whay glCOlorMaterail() is used. I read that "The command glColorMaterial() is used to minimize the performance costs associated with changing material properties. This command should be used whenever a single material property, such as diffuse color, must be changed for most vertices in the scene. Any change to the current color made by a call to glColor() immediately updates the material property specified by glColorMaterial()".

But I couldn't get anything from this on how, It effects lighting and glMaterialFv().

Deek**** M

04-29-2004, 02:20 AM
Hi !

It is just another way of changing material properties that is useful if you have a lot of triangles/lines/points that use the same material execept for example the diffuse color, you can then use glColor to just update the diffuse color or any other material property pretty fast.

the alternative is to use glMaterial...