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().