1GLGETMATERIAL(3G)                OpenGL Manual               GLGETMATERIAL(3G)
2
3
4

NAME

6       glGetMaterial - return material parameters
7

C SPECIFICATION

9       void glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params);
10
11       void glGetMaterialiv(GLenum face, GLenum pname, GLint * params);
12

PARAMETERS

14       face
15           Specifies which of the two materials is being queried.  GL_FRONT or
16           GL_BACK are accepted, representing the front and back materials,
17           respectively.
18
19       pname
20           Specifies the material parameter to return.  GL_AMBIENT,
21           GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, and
22           GL_COLOR_INDEXES are accepted.
23
24       params
25           Returns the requested data.
26

DESCRIPTION

28       glGetMaterial returns in params the value or values of parameter pname
29       of material face. Six parameters are defined:
30
31       GL_AMBIENT
32           params returns four integer or floating-point values representing
33           the ambient reflectance of the material. Integer values, when
34           requested, are linearly mapped from the internal floating-point
35           representation such that 1.0 maps to the most positive
36           representable integer value, and -1.0 maps to the most negative
37           representable integer value. If the internal value is outside the
38           range -1 1, the corresponding integer return value is undefined.
39           The initial value is (0.2, 0.2, 0.2, 1.0)
40
41       GL_DIFFUSE
42           params returns four integer or floating-point values representing
43           the diffuse reflectance of the material. Integer values, when
44           requested, are linearly mapped from the internal floating-point
45           representation such that 1.0 maps to the most positive
46           representable integer value, and -1.0 maps to the most negative
47           representable integer value. If the internal value is outside the
48           range -1 1, the corresponding integer return value is undefined.
49           The initial value is (0.8, 0.8, 0.8, 1.0).
50
51       GL_SPECULAR
52           params returns four integer or floating-point values representing
53           the specular reflectance of the material. Integer values, when
54           requested, are linearly mapped from the internal floating-point
55           representation such that 1.0 maps to the most positive
56           representable integer value, and -1.0 maps to the most negative
57           representable integer value. If the internal value is outside the
58           range -1 1, the corresponding integer return value is undefined.
59           The initial value is (0, 0, 0, 1).
60
61       GL_EMISSION
62           params returns four integer or floating-point values representing
63           the emitted light intensity of the material. Integer values, when
64           requested, are linearly mapped from the internal floating-point
65           representation such that 1.0 maps to the most positive
66           representable integer value, and -1.0 maps to the most negative
67           representable integer value. If the internal value is outside the
68           range -1 1, the corresponding integer return value is undefined.
69           The initial value is (0, 0, 0, 1).
70
71       GL_SHININESS
72           params returns one integer or floating-point value representing the
73           specular exponent of the material. Integer values, when requested,
74           are computed by rounding the internal floating-point value to the
75           nearest integer value. The initial value is 0.
76
77       GL_COLOR_INDEXES
78           params returns three integer or floating-point values representing
79           the ambient, diffuse, and specular indices of the material. These
80           indices are used only for color index lighting. (All the other
81           parameters are used only for RGBA lighting.) Integer values, when
82           requested, are computed by rounding the internal floating-point
83           values to the nearest integer values.
84

NOTES

86       If an error is generated, no change is made to the contents of params.
87

ERRORS

89       GL_INVALID_ENUM is generated if face or pname is not an accepted value.
90
91       GL_INVALID_OPERATION is generated if glGetMaterial is executed between
92       the execution of glBegin() and the corresponding execution of glEnd().
93

SEE ALSO

95       glMaterial()
96
98       Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
99       under the SGI Free Software B License. For details, see
100       http://oss.sgi.com/projects/FreeB/.
101

AUTHORS

103       opengl.org
104
105
106
107opengl.org                        06/10/2014                 GLGETMATERIAL(3G)
Impressum