forked from BSVino/docs.gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glGetLight.xhtml
160 lines (160 loc) · 11.8 KB
/
glGetLight.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<div class="refentry" lang="en" xml:lang="en"><a id="glGetLight"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetLight — return light source parameter values</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glGetLightfv</b>(</code></td><td>GLenum <var class="pdparam">light</var>, </td></tr><tr><td> </td><td>GLenum <var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfloat * <var class="pdparam">params</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glGetLightxv</b>(</code></td><td>GLenum <var class="pdparam">light</var>, </td></tr><tr><td> </td><td>GLenum <var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfixed * <var class="pdparam">params</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term">
<em class="parameter"><code>light</code></em>
</span></dt><dd><p>
Specifies a light source. The number of possible
lights depends on the implementation, but at least
eight lights are supported. They
are identified by symbolic names of the form
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>GL_LIGHTi</mml:mi> where
<mml:mi>0</mml:mi><mml:mo><</mml:mo><mml:mi>i</mml:mi><mml:mo><</mml:mo>
<mml:mi>GL_MAX_LIGHTS</mml:mi>
</mml:math>
</p></dd><dt><span class="term">
<em class="parameter"><code>pname</code></em>
</span></dt><dd><p>
Specifies a light source parameter for light.
Accepted symbolic names are
<code class="constant">GL_AMBIENT</code>,
<code class="constant">GL_DIFFUSE</code>,
<code class="constant">GL_SPECULAR</code>,
<code class="constant">GL_POSITION</code>,
<code class="constant">GL_SPOT_DIRECTION</code>,
<code class="constant">GL_SPOT_EXPONENT</code>,
<code class="constant">GL_SPOT_CUTOFF</code>,
<code class="constant">GL_CONSTANT_ATTENUATION</code>,
<code class="constant">GL_LINEAR_ATTENUATION</code>, and
<code class="constant">GL_QUADRATIC_ATTENUATION</code>.
</p></dd><dt><span class="term">
<em class="parameter"><code>params</code></em>
</span></dt><dd><p>
Returns the requested data.
</p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
<code class="function">glGetLight</code>
returns in <em class="parameter"><code>params</code></em> the value or values of a light
source parameter.
<em class="parameter"><code>light</code></em> names the light and is a symbolic
name of the form
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>GL_LIGHTi</mml:mi> for
<mml:mi>0</mml:mi><mml:mo><</mml:mo><mml:mi>i</mml:mi><mml:mo><</mml:mo>
<mml:mi>GL_MAX_LIGHTS</mml:mi>
</mml:math>
where <code class="constant">GL_MAX_LIGHTS</code> is an
implementation dependent constant that
is greater than or equal to eight.
<em class="parameter"><code>pname</code></em> specifies one of
ten light source parameters, again by symbolic name.
</p><p>The ten light parameters are defined:</p><div class="variablelist"><dl><dt><span class="term">
<code class="constant">GL_AMBIENT</code>
</span></dt><dd><p>
<em class="parameter"><code>params</code></em>
returns four fixed-point or floating-point values that
specify the ambient RGBA intensity of the light. Both
fixed-point and floating-point values are mapped
directly. Neither fixed-point nor floating-point values
are clamped.
The initial ambient light intensity is (0, 0, 0, 1).
</p></dd><dt><span class="term">
<code class="constant">GL_DIFFUSE</code>
</span></dt><dd><p>
<em class="parameter"><code>params</code></em>
returns four fixed-point or floating-point values that
specify the diffuse RGBA intensity of the light. Both
fixed-point and floating-point values are mapped
directly. Neither fixed-point nor floating-point values
are clamped.
The initial value for <code class="constant">GL_LIGHT0</code>
is (1, 1, 1, 1).
For other lights, the initial value is (0, 0, 0, 0).
</p></dd><dt><span class="term">
<code class="constant">GL_SPECULAR</code>
</span></dt><dd><p>
<em class="parameter"><code>params</code></em>
returns four fixed-point or floating-point values that
specify the specular RGBA intensity of the light. Both
fixed-point and floating-point values are mapped
directly. Neither fixed-point nor floating-point values
are clamped.
The initial value for <code class="constant">GL_LIGHT0</code>
is (1, 1, 1, 1).
For other lights, the initial value is (0, 0, 0, 0).
</p></dd><dt><span class="term"><code class="constant">GL_POSITION</code></span></dt><dd><p>
<em class="parameter"><code>params</code></em> returns four fixed-point or floating-point values representing the
position of the light source.
Both fixed-point and floating-point values are mapped
directly.
The returned values are those maintained in eye coordinates.
They will not be equal to the values specified using <a class="citerefentry" href="glLight"><span class="citerefentry"><span class="refentrytitle">glLight</span></span></a>,
unless the modelview matrix was identity at the time <a class="citerefentry" href="glLight"><span class="citerefentry"><span class="refentrytitle">glLight</span></span></a> was
called. The initial value is (0, 0, 1, 0).
</p></dd><dt><span class="term">
<code class="constant">GL_SPOT_DIRECTION</code>
</span></dt><dd><p>
<em class="parameter"><code>params</code></em>
returns three fixed-point or floating-point values that
specify the direction of the light in homogeneous object
coordinates. Both fixed-point and floating-point values
are mapped directly. Neither fixed-point nor
floating-point values are clamped.
The initial direction is (0, 0, -1).
</p></dd><dt><span class="term">
<code class="constant">GL_SPOT_EXPONENT</code>
</span></dt><dd><p>
<em class="parameter"><code>params</code></em>
returns a single fixed-point or floating-point value that
specifies the intensity distribution of the light.
Fixed-point and floating-point values are mapped
directly. Only values in the range [0, 128] are
accepted.
The initial spot exponent is 0.
</p></dd><dt><span class="term">
<code class="constant">GL_SPOT_CUTOFF</code>
</span></dt><dd><p>
<em class="parameter"><code>params</code></em>
returns a single fixed-point or floating-point value that
specifies the maximum spread angle of a light source.
Fixed-point and floating-point values are mapped
directly. Only values in the range [0, 90] and the special
value 180 are accepted. If the angle between the
direction of the light and the direction from the light
to the vertex being lighted is greater than the spot
cutoff angle, the light is completely masked.
Otherwise, its intensity is controlled by the spot
exponent and the attenuation factors. The initial spot
cutoff is 180.
</p></dd><dt><span class="term">
<code class="constant">GL_CONSTANT_ATTENUATION</code>,
<code class="constant">GL_LINEAR_ATTENUATION</code>,
<code class="constant">GL_QUADRATIC_ATTENUATION</code>
</span></dt><dd><p><em class="parameter"><code>params</code></em>
returns a single fixed-point or floating-point value that
specifies one of the three light attenuation factors.
Fixed-point and floating-point values are mapped
directly. Only nonnegative values are accepted. If the
light is positional, rather than directional, its
intensity is attenuated by the reciprocal of the sum of
the constant factor, the linear factor times the distance
between the light and the vertex being lighted, and the
quadratic factor times the square of the same distance.
The initial attenuation factors are (1, 0, 0).</p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
It is always the case that
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>GL_LIGHTi</mml:mi><mml:mo>=</mml:mo>
<mml:mi>GL_LIGHT0</mml:mi><mml:mo>+</mml:mo><code class="constant">i</code>.
</mml:math>
</p><p>
If an error is generated, no change is made to the contents
of <em class="parameter"><code>params</code></em>.
</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
<code class="constant">GL_INVALID_ENUM</code> is generated if
<em class="parameter"><code>light</code></em> or <em class="parameter"><code>pname</code></em>
is not an accepted value.
</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glLight"><span class="citerefentry"><span class="refentrytitle">glLight</span></span></a>
</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="copyright"></a><h2>Copyright</h2><p>
Copyright <span class="trademark"></span>© 2003-2004
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
<a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
</p></div></div>