02/06/2003
15-462 Graphics I
18
Defining Material Properties
•Material properties stay in effect
•Set both specular coefficients and shininess
•
•
•
•
•
•Diffuse component is analogous
•[Demo: Light material Tutor]
GLfloat mat_d[] = {0.1, 0.5, 0.8, 1.0};
GLfloat mat_s[] = {1.0, 1.0, 1.0, 1.0};
GLfloat low_sh[] = {5.0};
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_d);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_s);
glMaterialfv(GL_FRONT, GL_SHININESS, low_sh);