M
glMaterials
Chapter 11
285
glMaterials
glMaterialf, glMateriali, glMaterialfv, glMaterialiv: specify material
parameters for the lighting model.
C Specification
void glMaterialf(
GLenum face,
GLenum pname,
GLfloat param)
void glMateriali(
GLenum face,
GLenum pname,
GLint param)
void glMaterialfv(
GLenum face,
GLenum pname,
const GLfloat *params)
void glMaterialiv(
GLenum face,
GLenum pname,
const GLint *params)
Parameters
face Specifies which face or faces are being updated. Must be one of
GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.
pname Specifiesthe single-valued material parameter ofthe face or faces that
is being updated. Must be GL_SHININESS.
param Specifies the value that parameter GL_SHININESS will be set to.
face Specifies which face or faces are being updated. Must be one of
GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.
pname Specifies the material parameter of the face or faces that is being
updated. Must be one of GL_AMBIENT, GL_DIFFUSE,
GL_SPECULAR, GL_EMISSION, GL_SHININESS,
GL_AMBIENT_AND_DIFFUSE, or GL_COLOR_INDEXES.
params Specifies a pointer to the value or values that pname will be set to.
Description
glMaterial assigns values to material parameters. There are two matched sets of
material parameters. One, the front-facing set, is used to shade points, lines, bitmaps,
and all polygons (when two-sided lighting is disabled), or just front-facing polygons
(when two-sided lighting is enabled). The other set, back-facing, is used to shade
back-facing polygons only when two-sided lighting is enabled. Refer to the glLightModel
reference page for details concerning one- and two-sided lighting calculations.