GLMATERIAL
NAMEC SPECIFICATION
PARAMETERS
C SPECIFICATION
PARAMETERS
DESCRIPTION
NOTES
ERRORS
ASSOCIATED GETS
SEE ALSO
NAME
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 ) |
PARAMETERS
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 single-valued material parameter of the face or faces that is being updated. Must be GL_SHININESS. | ||
param |
Specifies the value that parameter GL_SHININESS will be set to. |
C SPECIFICATION
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 |
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.
glMaterial takes three arguments. The first, face, specifies whether the GL_FRONT materials, the GL_BACK materials, or both GL_FRONT_AND_BACK materials will be modified. The second, pname, specifies which of several parameters in one or both sets will be modified. The third, params, specifies what value or values will be assigned to the specified parameter.
Material parameters are used in the lighting equation that is optionally applied to each vertex. The equation is discussed in the glLightModel reference page. The parameters that can be specified using glMaterial, and their interpretations by the lighting equation, are as follows:
GL_AMBIENT |
params contains four integer or floating-point values that specify the ambient RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to −1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial ambient reflectance for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0). | ||
GL_DIFFUSE |
params contains four integer or floating-point values that specify the diffuse RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to −1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial diffuse reflectance for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0). | ||
GL_SPECULAR |
params contains four integer or floating-point values that specify the specular RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to −1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial specular reflectance for both front- and back-facing materials is (0, 0, 0, 1). | ||
GL_EMISSION |
params contains four integer or floating-point values that specify the RGBA emitted light intensity of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to −1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial emission intensity for both front- and back-facing materials is (0, 0, 0, 1). | ||
GL_SHININESS |
params is a single integer or floating-point value that specifies the RGBA specular exponent of the material. Integer and floating-point values are mapped directly. Only values in the range [0,128] are accepted. The initial specular exponent for both front- and back-facing materials is 0. |
GL_AMBIENT_AND_DIFFUSE
Equivalent to calling glMaterial twice with the same parameter values, once with GL_AMBIENT and once with GL_DIFFUSE.
GL_COLOR_INDEXES |
params contains three integer or floating-point values specifying the color indices for ambient, diffuse, and specular lighting. These three values, and GL_SHININESS, are the only material values used by the color index mode lighting equation. Refer to the glLightModel reference page for a discussion of color index lighting. |
NOTES
The material parameters can be updated at any time. In particular, glMaterial can be called between a call to glBegin and the corresponding call to glEnd. If only a single material parameter is to be changed per vertex, however, glColorMaterial is preferred over glMaterial (see glColorMaterial).
While the ambient, diffuse, specular and emission material parameters all have alpha components, only the diffuse alpha component is used in the lighting computation.
ERRORS
GL_INVALID_ENUM is generated if either face or pname is not an accepted value.
GL_INVALID_VALUE is generated if a specular exponent outside the range [0,128] is specified.
ASSOCIATED GETS
glGetMaterial
SEE ALSO
glColorMaterial(3G), glLight(3G), glLightModel(3G)
More Linux Commands
manpages/strtok.3.html
strtok(3) - extract tokens from strings - Linux manual page
The strtok() function breaks a string into a sequence of zero or more nonempty tokens. On the first call to strtok() the string to be parsed should be specified
manpages/CIRCLEQ_INSERT_BEFORE.3.html
CIRCLEQ_INSERT_BEFORE(3) implementations of lists, tail queu
These macros define and operate on three types of data structures: lists, tail queues, and circular queues. All three structures support the following functiona
manpages/wcsspn.3.html
wcsspn(3) - advance in a wide-character string, skipping any
The wcsspn() function is the wide-character equivalent of the strspn(3) function. It determines the length of the longest initial segment of wcs which consists
manpages/nextafterf.3.html
nextafterf(3) - floating-point number manipulation (ManPage)
The nextafter(), nextafterf(), and nextafterl() functions return the next representable floating-point value following x in the direction of y. If y is less tha
manpages/FcPatternDestroy.3.html
FcPatternDestroy(3) - Destroy a pattern - Linux manual page
Decrement the pattern reference count. If all references are gone, destroys the pattern, in the process destroying all related values. VERSION Fontconfig versio
manpages/ldap_controls.3.html
ldap_controls(3) - LDAP control manipulation routines.......
These routines are used to manipulate structures used for LDAP controls. ldap_control_create() creates a control with the specified OID using the contents of th
manpages/utmpname.3.html
utmpname(3) - access utmp file entries - Linux manual page
New applications should use the POSIX.1-specified utmpx versions of these functions; see CONFORMING TO. utmpname() sets the name of the utmp-format file for the
manpages/zshcompwid.1.html
zshcompwid(1) - zsh completion widgets - Linux manual page
The shells programmable completion mechanism can be manipulated in two ways; here the low-level features supporting the newer, function-based mechanism are defi
manpages/pmap.1.html
pmap(1) - display information about process memory mappings
pmap(1) displays information about a processs memory mappings, such as its stack, data segment, mapped files, and so on. The pmap(1) utility will show, for each
manpages/flushinp.3x.lc.html
flushinp.3x(lc) miscellaneous curses utility routines.......
The unctrl routine returns a character string which is a printable representation of the character c, ignoring attributes. Control characters are displayed in t
manpages/getpw.3.html
getpw(3) - Re-construct password line entry - Linux man page
The getpw() function reconstructs the password line entry for the given user ID uid in the buffer buf. The returned buffer contains a line of format name:passwd
manpages/sa-awl.1.html
sa-awl(1) - examine and manipulate SpamAssassin's auto-white
Check or clean a SpamAssassin auto-whitelist ( AWL ) database file. The name of the file is specified after any options, as dbfile. The default is $HOME/.spamas
