bcacb5bc0b348766f7c674e0cfa9ccbb093ddb18
[clinton/guile-figl.git] / upstream-man-pages / man2 / xhtml / glTexParameter.xml
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
2 <!-- saved from url=(0013)about:internet -->
3 <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glTexParameter</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glTexParameter"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glTexParameter — set texture parameters</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glTexParameterf</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfloat  </td><td><var class="pdparam">param</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glTexParameteri</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">param</var><code>)</code>;</td></tr></table></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>target</code></em></span></dt><dd><p>
4 Specifies the target texture,
5 which must be either <code class="constant">GL_TEXTURE_1D</code>, <code class="constant">GL_TEXTURE_2D</code>,
6 <code class="constant">GL_TEXTURE_3D</code>, or <code class="constant">GL_TEXTURE_CUBE_MAP</code>.
7 </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p>
8 Specifies the symbolic name of a single-valued texture parameter.
9 <em class="parameter"><code>pname</code></em> can be one of the following:
10 <code class="constant">GL_TEXTURE_MIN_FILTER</code>,
11 <code class="constant">GL_TEXTURE_MAG_FILTER</code>,
12 <code class="constant">GL_TEXTURE_MIN_LOD</code>,
13 <code class="constant">GL_TEXTURE_MAX_LOD</code>,
14 <code class="constant">GL_TEXTURE_BASE_LEVEL</code>,
15 <code class="constant">GL_TEXTURE_MAX_LEVEL</code>,
16 <code class="constant">GL_TEXTURE_WRAP_S</code>,
17 <code class="constant">GL_TEXTURE_WRAP_T</code>,
18 <code class="constant">GL_TEXTURE_WRAP_R</code>,
19 <code class="constant">GL_TEXTURE_PRIORITY</code>,
20 <code class="constant">GL_TEXTURE_COMPARE_MODE</code>,
21 <code class="constant">GL_TEXTURE_COMPARE_FUNC</code>,
22 <code class="constant">GL_DEPTH_TEXTURE_MODE</code>, or
23 <code class="constant">GL_GENERATE_MIPMAP</code>.
24 </p></dd><dt><span class="term"><em class="parameter"><code>param</code></em></span></dt><dd><p>
25 Specifies the value of <em class="parameter"><code>pname</code></em>.
26 </p></dd></dl></div></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glTexParameterfv</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>const GLfloat *  </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glTexParameteriv</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>const GLint *  </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters2"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p>
27 Specifies the target texture,
28 which must be either <code class="constant">GL_TEXTURE_1D</code>, <code class="constant">GL_TEXTURE_2D</code> or
29 <code class="constant">GL_TEXTURE_3D</code>.
30 </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p>
31 Specifies the symbolic name of a texture parameter.
32 <em class="parameter"><code>pname</code></em> can be one of the following:
33 <code class="constant">GL_TEXTURE_MIN_FILTER</code>,
34 <code class="constant">GL_TEXTURE_MAG_FILTER</code>,
35 <code class="constant">GL_TEXTURE_MIN_LOD</code>,
36 <code class="constant">GL_TEXTURE_MAX_LOD</code>,
37 <code class="constant">GL_TEXTURE_BASE_LEVEL</code>,
38 <code class="constant">GL_TEXTURE_MAX_LEVEL</code>,
39 <code class="constant">GL_TEXTURE_WRAP_S</code>,
40 <code class="constant">GL_TEXTURE_WRAP_T</code>,
41 <code class="constant">GL_TEXTURE_WRAP_R</code>,
42 <code class="constant">GL_TEXTURE_BORDER_COLOR</code>,
43 <code class="constant">GL_TEXTURE_PRIORITY</code>,
44 <code class="constant">GL_TEXTURE_COMPARE_MODE</code>,
45 <code class="constant">GL_TEXTURE_COMPARE_FUNC</code>,
46 <code class="constant">GL_DEPTH_TEXTURE_MODE</code>, or
47 <code class="constant">GL_GENERATE_MIPMAP</code>.
48 </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p>
49 Specifies a pointer to an array where the value or values of <em class="parameter"><code>pname</code></em>
50 are stored.
51 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
52 Texture mapping is a technique that applies an image onto an object's surface
53 as if the image were a decal or cellophane shrink-wrap.
54 The image is created in texture space,
55 with an
56 (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>,
57 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">t</mml:mi></mml:math>)
58 coordinate system.
59 A texture is a one- or two-dimensional image and a set of parameters
60 that determine how samples are derived from the image.
61 </p><p>
62 <code class="function">glTexParameter</code> assigns the value or values in <em class="parameter"><code>params</code></em> to the texture parameter
63 specified as <em class="parameter"><code>pname</code></em>.
64 <em class="parameter"><code>target</code></em> defines the target texture,
65 either <code class="constant">GL_TEXTURE_1D</code>, <code class="constant">GL_TEXTURE_2D</code>, or <code class="constant">GL_TEXTURE_3D</code>.
66 The following symbols are accepted in <em class="parameter"><code>pname</code></em>:
67 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_MIN_FILTER</code></span></dt><dd><p>
68 The texture minifying function is used whenever the pixel being textured
69 maps to an area greater than one texture element.
70 There are six defined minifying functions.
71 Two of them use the nearest one or nearest four texture elements
72 to compute the texture value.
73 The other four use mipmaps.
74 </p><p>
75 A mipmap is an ordered set of arrays representing the same image
76 at progressively lower resolutions.
77 If the texture has dimensions
78 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
79
80 <mml:mrow>
81 <mml:msup><mml:mn>2</mml:mn>
82 <mml:mi mathvariant="italic">n</mml:mi>
83 </mml:msup>
84 <mml:mo>×</mml:mo>
85 <mml:msup><mml:mn>2</mml:mn>
86 <mml:mi mathvariant="italic">m</mml:mi>
87 </mml:msup>
88 </mml:mrow>
89 </mml:math>,
90 there are
91 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
92
93 <mml:mrow>
94 <mml:mrow>
95 <mml:mi mathvariant="italic">max</mml:mi>
96 <mml:mo></mml:mo>
97 <mml:mfenced open="(" close=")">
98 <mml:mi mathvariant="italic">n</mml:mi>
99 <mml:mi mathvariant="italic">m</mml:mi>
100 </mml:mfenced>
101 </mml:mrow>
102 <mml:mo>+</mml:mo>
103 <mml:mn>1</mml:mn>
104 </mml:mrow>
105 </mml:math>
106 mipmaps.
107 The first mipmap is the original texture,
108 with dimensions
109 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
110
111 <mml:mrow>
112 <mml:msup><mml:mn>2</mml:mn>
113 <mml:mi mathvariant="italic">n</mml:mi>
114 </mml:msup>
115 <mml:mo>×</mml:mo>
116 <mml:msup><mml:mn>2</mml:mn>
117 <mml:mi mathvariant="italic">m</mml:mi>
118 </mml:msup>
119 </mml:mrow>
120 </mml:math>.
121 Each subsequent mipmap has dimensions
122 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
123
124 <mml:mrow>
125 <mml:msup><mml:mn>2</mml:mn>
126 <mml:mfenced open="" close="">
127 <mml:mrow>
128 <mml:mi mathvariant="italic">k</mml:mi>
129 <mml:mo>-</mml:mo>
130 <mml:mn>1</mml:mn>
131 </mml:mrow>
132 </mml:mfenced>
133 </mml:msup>
134 <mml:mo>×</mml:mo>
135 <mml:msup><mml:mn>2</mml:mn>
136 <mml:mfenced open="" close="">
137 <mml:mrow>
138 <mml:mi mathvariant="italic">l</mml:mi>
139 <mml:mo>-</mml:mo>
140 <mml:mn>1</mml:mn>
141 </mml:mrow>
142 </mml:mfenced>
143 </mml:msup>
144 </mml:mrow>
145 </mml:math>,
146 where
147 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
148
149 <mml:mrow>
150 <mml:msup><mml:mn>2</mml:mn>
151 <mml:mi mathvariant="italic">k</mml:mi>
152 </mml:msup>
153 <mml:mo>×</mml:mo>
154 <mml:msup><mml:mn>2</mml:mn>
155 <mml:mi mathvariant="italic">l</mml:mi>
156 </mml:msup>
157 </mml:mrow>
158 </mml:math>
159 are the dimensions of the previous mipmap,
160 until either
161 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
162
163 <mml:mrow>
164 <mml:mi mathvariant="italic">k</mml:mi>
165 <mml:mo>=</mml:mo>
166 <mml:mn>0</mml:mn>
167 </mml:mrow>
168 </mml:math>
169 or
170 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
171
172 <mml:mrow>
173 <mml:mi mathvariant="italic">l</mml:mi>
174 <mml:mo>=</mml:mo>
175 <mml:mn>0</mml:mn>
176 </mml:mrow>
177 </mml:math>.
178 At that point,
179 subsequent mipmaps have dimension
180 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
181
182 <mml:mrow>
183 <mml:mn>1</mml:mn>
184 <mml:mo>×</mml:mo>
185 <mml:msup><mml:mn>2</mml:mn>
186 <mml:mfenced open="" close="">
187 <mml:mrow>
188 <mml:mi mathvariant="italic">l</mml:mi>
189 <mml:mo>-</mml:mo>
190 <mml:mn>1</mml:mn>
191 </mml:mrow>
192 </mml:mfenced>
193 </mml:msup>
194 </mml:mrow>
195 </mml:math>
196 or
197 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
198
199 <mml:mrow>
200 <mml:msup><mml:mn>2</mml:mn>
201 <mml:mfenced open="" close="">
202 <mml:mrow>
203 <mml:mi mathvariant="italic">k</mml:mi>
204 <mml:mo>-</mml:mo>
205 <mml:mn>1</mml:mn>
206 </mml:mrow>
207 </mml:mfenced>
208 </mml:msup>
209 <mml:mo>×</mml:mo>
210 <mml:mn>1</mml:mn>
211 </mml:mrow>
212 </mml:math>
213 until the final mipmap,
214 which has dimension
215 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
216
217 <mml:mrow>
218 <mml:mn>1</mml:mn>
219 <mml:mo>×</mml:mo>
220 <mml:mn>1</mml:mn>
221 </mml:mrow>
222 </mml:math>.
223 To define the mipmaps, call <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, <a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
224 <a class="citerefentry" href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
225 <a class="citerefentry" href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, or <a class="citerefentry" href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>
226 with the <span class="emphasis"><em>level</em></span> argument indicating the order of the mipmaps.
227 Level 0 is the original texture;
228 level
229 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
230
231 <mml:mrow>
232 <mml:mi mathvariant="italic">max</mml:mi>
233 <mml:mo></mml:mo>
234 <mml:mfenced open="(" close=")">
235 <mml:mi mathvariant="italic">n</mml:mi>
236 <mml:mi mathvariant="italic">m</mml:mi>
237 </mml:mfenced>
238 </mml:mrow>
239 </mml:math>
240 is the final
241 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
242
243 <mml:mrow>
244 <mml:mn>1</mml:mn>
245 <mml:mo>×</mml:mo>
246 <mml:mn>1</mml:mn>
247 </mml:mrow>
248 </mml:math>
249 mipmap.
250 </p><p>
251 <em class="parameter"><code>params</code></em> supplies a function for minifying the texture as one of the
252 following:
253 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_NEAREST</code></span></dt><dd><p>
254 Returns the value of the texture element that is nearest
255 (in Manhattan distance)
256 to the center of the pixel being textured.
257 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR</code></span></dt><dd><p>
258 Returns the weighted average of the four texture elements
259 that are closest to the center of the pixel being textured.
260 These can include border texture elements,
261 depending on the values of <code class="constant">GL_TEXTURE_WRAP_S</code> and <code class="constant">GL_TEXTURE_WRAP_T</code>,
262 and on the exact mapping.
263 </p></dd><dt><span class="term"><code class="constant">GL_NEAREST_MIPMAP_NEAREST</code></span></dt><dd><p>
264 Chooses the mipmap that most closely matches the size of the pixel
265 being textured and uses the <code class="constant">GL_NEAREST</code> criterion
266 (the texture element nearest to the center of the pixel)
267 to produce a texture value.
268 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR_MIPMAP_NEAREST</code></span></dt><dd><p>
269 Chooses the mipmap that most closely matches the size of the pixel
270 being textured and uses the <code class="constant">GL_LINEAR</code> criterion
271 (a weighted average of the four texture elements that are closest
272 to the center of the pixel)
273 to produce a texture value.
274 </p></dd><dt><span class="term"><code class="constant">GL_NEAREST_MIPMAP_LINEAR</code></span></dt><dd><p>
275 Chooses the two mipmaps that most closely match the size of the pixel
276 being textured and uses the <code class="constant">GL_NEAREST</code> criterion
277 (the texture element nearest to the center of the pixel)
278 to produce a texture value from each mipmap.
279 The final texture value is a weighted average of those two values.
280 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR_MIPMAP_LINEAR</code></span></dt><dd><p>
281 Chooses the two mipmaps that most closely match the size of the pixel
282 being textured and uses the <code class="constant">GL_LINEAR</code> criterion
283 (a weighted average of the four texture elements that are closest
284 to the center of the pixel)
285 to produce a texture value from each mipmap.
286 The final texture value is a weighted average of those two values.
287 </p></dd></dl></div><p>
288 </p><p>
289 As more texture elements are sampled in the minification process,
290 fewer aliasing artifacts will be apparent.
291 While the <code class="constant">GL_NEAREST</code> and <code class="constant">GL_LINEAR</code> minification functions can be
292 faster than the other four,
293 they sample only one or four texture elements to determine the texture value
294 of the pixel being rendered and can produce moire patterns
295 or ragged transitions.
296 The initial value of <code class="constant">GL_TEXTURE_MIN_FILTER</code> is
297 <code class="constant">GL_NEAREST_MIPMAP_LINEAR</code>.
298 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_MAG_FILTER</code></span></dt><dd><p>
299 The texture magnification function is used when the pixel being textured
300 maps to an area less than or equal to one texture element.
301 It sets the texture magnification function to either <code class="constant">GL_NEAREST</code>
302 or <code class="constant">GL_LINEAR</code> (see below). <code class="constant">GL_NEAREST</code> is generally faster
303 than <code class="constant">GL_LINEAR</code>,
304 but it can produce textured images with sharper edges
305 because the transition between texture elements is not as smooth.
306 The initial value of <code class="constant">GL_TEXTURE_MAG_FILTER</code> is <code class="constant">GL_LINEAR</code>.
307 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_NEAREST</code></span></dt><dd><p>
308 Returns the value of the texture element that is nearest
309 (in Manhattan distance)
310 to the center of the pixel being textured.
311 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR</code></span></dt><dd><p>
312 Returns the weighted average of the four texture elements
313 that are closest to the center of the pixel being textured.
314 These can include border texture elements,
315 depending on the values of <code class="constant">GL_TEXTURE_WRAP_S</code> and <code class="constant">GL_TEXTURE_WRAP_T</code>,
316 and on the exact mapping.
317 </p></dd></dl></div><p>
318 </p><p>
319 </p><p>
320 </p></dd></dl></div><p>
321 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_MIN_LOD</code></span></dt><dd><p>
322 Sets the minimum level-of-detail parameter. This floating-point value
323 limits the selection of highest resolution mipmap (lowest mipmap
324 level). The initial value is -1000.
325 </p></dd></dl></div><p>
326 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_MAX_LOD</code></span></dt><dd><p>
327 Sets the maximum level-of-detail parameter. This floating-point value
328 limits the selection of the lowest resolution mipmap (highest mipmap
329 level). The initial value is 1000.
330 </p></dd></dl></div><p>
331 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_BASE_LEVEL</code></span></dt><dd><p>
332 Specifies the index of the lowest defined mipmap level. This is an
333 integer value. The initial value is 0.
334 </p></dd></dl></div><p>
335 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_MAX_LEVEL</code></span></dt><dd><p>
336 Sets the index of the highest defined mipmap level. This is an integer
337 value. The initial value is 1000.
338 </p></dd></dl></div><p>
339 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_WRAP_S</code></span></dt><dd><p>
340 Sets the wrap parameter for texture coordinate
341 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
342 to either <code class="constant">GL_CLAMP</code>,
343 <code class="constant">GL_CLAMP_TO_BORDER</code>, <code class="constant">GL_CLAMP_TO_EDGE</code>, <code class="constant">GL_MIRRORED_REPEAT</code>, or
344 <code class="constant">GL_REPEAT</code>. <code class="constant">GL_CLAMP</code> causes
345 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
346 coordinates to be clamped to the
347 range [0,1] and is useful for preventing wrapping artifacts when mapping a
348 single image onto an object. <code class="constant">GL_CLAMP_TO_BORDER</code> causes the
349 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
350 coordinate to be clamped to the range
351 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
352
353 <mml:mfenced open="[" close="]">
354 <mml:mfenced open="" close="">
355 <mml:mrow>
356 <mml:mfrac>
357 <mml:mn>-1</mml:mn>
358 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
359 </mml:mfrac>
360 </mml:mrow>
361 </mml:mfenced>
362 <mml:mrow>
363 <mml:mn>1</mml:mn>
364 <mml:mo>+</mml:mo>
365 <mml:mfenced open="" close="">
366 <mml:mrow>
367 <mml:mfrac>
368 <mml:mn>1</mml:mn>
369 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
370 </mml:mfrac>
371 </mml:mrow>
372 </mml:mfenced>
373 </mml:mrow>
374 </mml:mfenced>
375 </mml:math>,
376 where
377 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math>
378 is the size of the texture in the direction of
379 clamping.<code class="constant">GL_CLAMP_TO_EDGE</code> causes
380 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
381 coordinates to be clamped to the
382 range
383 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
384
385 <mml:mfenced open="[" close="]">
386 <mml:mfenced open="" close="">
387 <mml:mrow>
388 <mml:mfrac>
389 <mml:mn>1</mml:mn>
390 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
391 </mml:mfrac>
392 </mml:mrow>
393 </mml:mfenced>
394 <mml:mrow>
395 <mml:mn>1</mml:mn>
396 <mml:mo>-</mml:mo>
397 <mml:mfenced open="" close="">
398 <mml:mrow>
399 <mml:mfrac>
400 <mml:mn>1</mml:mn>
401 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
402 </mml:mfrac>
403 </mml:mrow>
404 </mml:mfenced>
405 </mml:mrow>
406 </mml:mfenced>
407 </mml:math>,
408 where
409 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math>
410 is the size
411 of the texture in the direction of clamping. <code class="constant">GL_REPEAT</code> causes the
412 integer part of the
413 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
414 coordinate to be ignored; the GL uses only the
415 fractional part, thereby creating a repeating pattern.
416 <code class="constant">GL_MIRRORED_REPEAT</code> causes the
417 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
418 coordinate to be set to the
419 fractional part of the texture coordinate if the integer part of
420 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
421 is
422 even; if the integer part of
423 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
424 is odd, then the
425 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
426 texture coordinate is
427 set to
428 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
429
430 <mml:mrow>
431 <mml:mn>1</mml:mn>
432 <mml:mo>-</mml:mo>
433 <mml:mrow>
434 <mml:mi mathvariant="italic">frac</mml:mi>
435 <mml:mo></mml:mo>
436 <mml:mfenced open="(" close=")">
437 <mml:mi mathvariant="italic">s</mml:mi>
438 </mml:mfenced>
439 </mml:mrow>
440 </mml:mrow>
441 </mml:math>,
442 where
443 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
444
445 <mml:mrow>
446 <mml:mi mathvariant="italic">frac</mml:mi>
447 <mml:mo></mml:mo>
448 <mml:mfenced open="(" close=")">
449 <mml:mi mathvariant="italic">s</mml:mi>
450 </mml:mfenced>
451 </mml:mrow>
452 </mml:math>
453 represents the fractional part of
454 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>.
455 Border texture
456 elements are accessed only if wrapping is set to <code class="constant">GL_CLAMP</code> or <code class="constant">GL_CLAMP_TO_BORDER</code>. Initially,
457 <code class="constant">GL_TEXTURE_WRAP_S</code> is set to <code class="constant">GL_REPEAT</code>.
458 </p></dd></dl></div><p>
459 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_WRAP_T</code></span></dt><dd><p>
460 Sets the wrap parameter for texture coordinate
461 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">t</mml:mi></mml:math>
462 to either <code class="constant">GL_CLAMP</code>,
463 <code class="constant">GL_CLAMP_TO_BORDER</code>, <code class="constant">GL_CLAMP_TO_EDGE</code>, <code class="constant">GL_MIRRORED_REPEAT</code>, or
464 <code class="constant">GL_REPEAT</code>. See the discussion under <code class="constant">GL_TEXTURE_WRAP_S</code>.
465 Initially, <code class="constant">GL_TEXTURE_WRAP_T</code> is set to <code class="constant">GL_REPEAT</code>.
466 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_WRAP_R</code></span></dt><dd><p>
467 Sets the wrap parameter for texture coordinate
468 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math>
469 to either <code class="constant">GL_CLAMP</code>,
470 <code class="constant">GL_CLAMP_TO_BORDER</code>, <code class="constant">GL_CLAMP_TO_EDGE</code>, <code class="constant">GL_MIRRORED_REPEAT</code>, or
471 <code class="constant">GL_REPEAT</code>. See the discussion under <code class="constant">GL_TEXTURE_WRAP_S</code>.
472 Initially, <code class="constant">GL_TEXTURE_WRAP_R</code> is set to <code class="constant">GL_REPEAT</code>.
473 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_BORDER_COLOR</code></span></dt><dd><p>
474 Sets a border color. <em class="parameter"><code>params</code></em> contains four values that comprise the RGBA
475 color of the texture border. Integer color components are interpreted
476 linearly such that the most positive integer maps to 1.0, and the most
477 negative integer maps to -1.0. The values are clamped to the range [0,1]
478 when they are specified. Initially, the border color is (0, 0, 0, 0).
479 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_PRIORITY</code></span></dt><dd><p>
480 Specifies the texture residence priority of the currently bound texture.
481 Permissible values are in the range
482 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
483
484 <mml:mfenced open="[" close="]">
485 <mml:mn>0</mml:mn>
486 <mml:mn>1</mml:mn>
487 </mml:mfenced>
488 </mml:math>.
489 See <a class="citerefentry" href="glPrioritizeTextures.xml"><span class="citerefentry"><span class="refentrytitle">glPrioritizeTextures</span></span></a> and <a class="citerefentry" href="glBindTexture.xml"><span class="citerefentry"><span class="refentrytitle">glBindTexture</span></span></a> for more information.
490 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPARE_MODE</code></span></dt><dd><p>
491 Specifies the texture comparison mode for currently bound depth textures.
492 That is, a texture whose internal format is <code class="constant">GL_DEPTH_COMPONENT_*</code>; see
493 <a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>)
494 Permissible values are:
495 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_COMPARE_R_TO_TEXTURE</code></span></dt><dd><p>
496 Specifies that the interpolated and clamped
497 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math>
498 texture coordinate should
499 be compared to the value in the currently bound depth texture. See the
500 discussion of <code class="constant">GL_TEXTURE_COMPARE_FUNC</code> for details of how the comparison
501 is evaluated. The result of the comparison is assigned to luminance,
502 intensity, or alpha (as specified by <code class="constant">GL_DEPTH_TEXTURE_MODE</code>).
503 </p></dd><dt><span class="term"><code class="constant">GL_NONE</code></span></dt><dd><p>
504 Specifies that the luminance, intensity, or alpha (as specified by
505 <code class="constant">GL_DEPTH_TEXTURE_MODE</code>) should be assigned the
506 appropriate value from the currently bound depth texture.
507 </p></dd></dl></div><p>
508 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPARE_FUNC</code></span></dt><dd><p>
509 Specifies the comparison operator used when <code class="constant">GL_TEXTURE_COMPARE_MODE</code> is
510 set to <code class="constant">GL_COMPARE_R_TO_TEXTURE</code>. Permissible values are:
511 </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
512 Texture Comparison Function
513 </strong></span></th><th align="left"><span class="bold"><strong>
514 Computed result
515 </strong></span></th></tr></thead><tbody><tr><td align="left">
516 <code class="constant">GL_LEQUAL</code>
517 </td><td align="left">
518 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
519
520 <mml:mrow>
521 <mml:mi mathvariant="italic">result</mml:mi>
522 <mml:mo>=</mml:mo>
523 <mml:mfenced open="{" close="">
524 <mml:mrow>
525 <mml:mtable>
526 <mml:mtr><mml:mtd>
527 <mml:mn>1.0</mml:mn>
528 </mml:mtd></mml:mtr>
529 <mml:mtr><mml:mtd>
530 <mml:mn>0.0</mml:mn>
531 </mml:mtd></mml:mtr>
532 </mml:mtable>
533 <mml:mo>⁢  </mml:mo>
534 <mml:mtable>
535 <mml:mtr><mml:mtd>
536 <mml:mrow>
537 <mml:mi mathvariant="italic">r</mml:mi>
538 <mml:mo>&lt;=</mml:mo>
539 <mml:mfenced open="" close="">
540 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
541 <mml:mi mathvariant="italic">t</mml:mi>
542 </mml:msub>
543 </mml:mfenced>
544 </mml:mrow>
545 </mml:mtd></mml:mtr>
546 <mml:mtr><mml:mtd>
547 <mml:mrow>
548 <mml:mi mathvariant="italic">r</mml:mi>
549 <mml:mo>&gt;</mml:mo>
550 <mml:mfenced open="" close="">
551 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
552 <mml:mi mathvariant="italic">t</mml:mi>
553 </mml:msub>
554 </mml:mfenced>
555 </mml:mrow>
556 </mml:mtd></mml:mtr>
557 </mml:mtable>
558 </mml:mrow>
559 </mml:mfenced>
560 </mml:mrow>
561 </mml:math></div>
562 </td></tr><tr><td align="left">
563 <code class="constant">GL_GEQUAL</code>
564 </td><td align="left">
565 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
566
567 <mml:mrow>
568 <mml:mi mathvariant="italic">result</mml:mi>
569 <mml:mo>=</mml:mo>
570 <mml:mfenced open="{" close="">
571 <mml:mrow>
572 <mml:mtable>
573 <mml:mtr><mml:mtd>
574 <mml:mn>1.0</mml:mn>
575 </mml:mtd></mml:mtr>
576 <mml:mtr><mml:mtd>
577 <mml:mn>0.0</mml:mn>
578 </mml:mtd></mml:mtr>
579 </mml:mtable>
580 <mml:mo>⁢  </mml:mo>
581 <mml:mtable>
582 <mml:mtr><mml:mtd>
583 <mml:mrow>
584 <mml:mi mathvariant="italic">r</mml:mi>
585 <mml:mo>&gt;=</mml:mo>
586 <mml:mfenced open="" close="">
587 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
588 <mml:mi mathvariant="italic">t</mml:mi>
589 </mml:msub>
590 </mml:mfenced>
591 </mml:mrow>
592 </mml:mtd></mml:mtr>
593 <mml:mtr><mml:mtd>
594 <mml:mrow>
595 <mml:mi mathvariant="italic">r</mml:mi>
596 <mml:mo>&lt;</mml:mo>
597 <mml:mfenced open="" close="">
598 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
599 <mml:mi mathvariant="italic">t</mml:mi>
600 </mml:msub>
601 </mml:mfenced>
602 </mml:mrow>
603 </mml:mtd></mml:mtr>
604 </mml:mtable>
605 </mml:mrow>
606 </mml:mfenced>
607 </mml:mrow>
608 </mml:math></div>
609 </td></tr><tr><td align="left">
610 <code class="constant">GL_LESS</code>
611 </td><td align="left">
612 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
613
614 <mml:mrow>
615 <mml:mi mathvariant="italic">result</mml:mi>
616 <mml:mo>=</mml:mo>
617 <mml:mfenced open="{" close="">
618 <mml:mrow>
619 <mml:mtable>
620 <mml:mtr><mml:mtd>
621 <mml:mn>1.0</mml:mn>
622 </mml:mtd></mml:mtr>
623 <mml:mtr><mml:mtd>
624 <mml:mn>0.0</mml:mn>
625 </mml:mtd></mml:mtr>
626 </mml:mtable>
627 <mml:mo>⁢  </mml:mo>
628 <mml:mtable>
629 <mml:mtr><mml:mtd>
630 <mml:mrow>
631 <mml:mi mathvariant="italic">r</mml:mi>
632 <mml:mo>&lt;</mml:mo>
633 <mml:mfenced open="" close="">
634 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
635 <mml:mi mathvariant="italic">t</mml:mi>
636 </mml:msub>
637 </mml:mfenced>
638 </mml:mrow>
639 </mml:mtd></mml:mtr>
640 <mml:mtr><mml:mtd>
641 <mml:mrow>
642 <mml:mi mathvariant="italic">r</mml:mi>
643 <mml:mo>&gt;=</mml:mo>
644 <mml:mfenced open="" close="">
645 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
646 <mml:mi mathvariant="italic">t</mml:mi>
647 </mml:msub>
648 </mml:mfenced>
649 </mml:mrow>
650 </mml:mtd></mml:mtr>
651 </mml:mtable>
652 </mml:mrow>
653 </mml:mfenced>
654 </mml:mrow>
655 </mml:math></div>
656 </td></tr><tr><td align="left">
657 <code class="constant">GL_GREATER</code>
658 </td><td align="left">
659 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
660
661 <mml:mrow>
662 <mml:mi mathvariant="italic">result</mml:mi>
663 <mml:mo>=</mml:mo>
664 <mml:mfenced open="{" close="">
665 <mml:mrow>
666 <mml:mtable>
667 <mml:mtr><mml:mtd>
668 <mml:mn>1.0</mml:mn>
669 </mml:mtd></mml:mtr>
670 <mml:mtr><mml:mtd>
671 <mml:mn>0.0</mml:mn>
672 </mml:mtd></mml:mtr>
673 </mml:mtable>
674 <mml:mo>⁢  </mml:mo>
675 <mml:mtable>
676 <mml:mtr><mml:mtd>
677 <mml:mrow>
678 <mml:mi mathvariant="italic">r</mml:mi>
679 <mml:mo>&gt;</mml:mo>
680 <mml:mfenced open="" close="">
681 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
682 <mml:mi mathvariant="italic">t</mml:mi>
683 </mml:msub>
684 </mml:mfenced>
685 </mml:mrow>
686 </mml:mtd></mml:mtr>
687 <mml:mtr><mml:mtd>
688 <mml:mrow>
689 <mml:mi mathvariant="italic">r</mml:mi>
690 <mml:mo>&lt;=</mml:mo>
691 <mml:mfenced open="" close="">
692 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
693 <mml:mi mathvariant="italic">t</mml:mi>
694 </mml:msub>
695 </mml:mfenced>
696 </mml:mrow>
697 </mml:mtd></mml:mtr>
698 </mml:mtable>
699 </mml:mrow>
700 </mml:mfenced>
701 </mml:mrow>
702 </mml:math></div>
703 </td></tr><tr><td align="left">
704 <code class="constant">GL_EQUAL</code>
705 </td><td align="left">
706 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
707
708 <mml:mrow>
709 <mml:mi mathvariant="italic">result</mml:mi>
710 <mml:mo>=</mml:mo>
711 <mml:mfenced open="{" close="">
712 <mml:mrow>
713 <mml:mtable>
714 <mml:mtr><mml:mtd>
715 <mml:mn>1.0</mml:mn>
716 </mml:mtd></mml:mtr>
717 <mml:mtr><mml:mtd>
718 <mml:mn>0.0</mml:mn>
719 </mml:mtd></mml:mtr>
720 </mml:mtable>
721 <mml:mo>⁢  </mml:mo>
722 <mml:mtable>
723 <mml:mtr><mml:mtd>
724 <mml:mrow>
725 <mml:mi mathvariant="italic">r</mml:mi>
726 <mml:mo>=</mml:mo>
727 <mml:mfenced open="" close="">
728 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
729 <mml:mi mathvariant="italic">t</mml:mi>
730 </mml:msub>
731 </mml:mfenced>
732 </mml:mrow>
733 </mml:mtd></mml:mtr>
734 <mml:mtr><mml:mtd>
735 <mml:mrow>
736 <mml:mi mathvariant="italic">r</mml:mi>
737 <mml:mo></mml:mo>
738 <mml:mfenced open="" close="">
739 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
740 <mml:mi mathvariant="italic">t</mml:mi>
741 </mml:msub>
742 </mml:mfenced>
743 </mml:mrow>
744 </mml:mtd></mml:mtr>
745 </mml:mtable>
746 </mml:mrow>
747 </mml:mfenced>
748 </mml:mrow>
749 </mml:math></div>
750 </td></tr><tr><td align="left">
751 <code class="constant">GL_NOTEQUAL</code>
752 </td><td align="left">
753 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
754
755 <mml:mrow>
756 <mml:mi mathvariant="italic">result</mml:mi>
757 <mml:mo>=</mml:mo>
758 <mml:mfenced open="{" close="">
759 <mml:mrow>
760 <mml:mtable>
761 <mml:mtr><mml:mtd>
762 <mml:mn>1.0</mml:mn>
763 </mml:mtd></mml:mtr>
764 <mml:mtr><mml:mtd>
765 <mml:mn>0.0</mml:mn>
766 </mml:mtd></mml:mtr>
767 </mml:mtable>
768 <mml:mo>⁢  </mml:mo>
769 <mml:mtable>
770 <mml:mtr><mml:mtd>
771 <mml:mrow>
772 <mml:mi mathvariant="italic">r</mml:mi>
773 <mml:mo></mml:mo>
774 <mml:mfenced open="" close="">
775 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
776 <mml:mi mathvariant="italic">t</mml:mi>
777 </mml:msub>
778 </mml:mfenced>
779 </mml:mrow>
780 </mml:mtd></mml:mtr>
781 <mml:mtr><mml:mtd>
782 <mml:mrow>
783 <mml:mi mathvariant="italic">r</mml:mi>
784 <mml:mo>=</mml:mo>
785 <mml:mfenced open="" close="">
786 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
787 <mml:mi mathvariant="italic">t</mml:mi>
788 </mml:msub>
789 </mml:mfenced>
790 </mml:mrow>
791 </mml:mtd></mml:mtr>
792 </mml:mtable>
793 </mml:mrow>
794 </mml:mfenced>
795 </mml:mrow>
796 </mml:math></div>
797 </td></tr><tr><td align="left">
798 <code class="constant">GL_ALWAYS</code>
799 </td><td align="left">
800 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
801 <mml:mrow>
802 <mml:mi mathvariant="italic">result</mml:mi>
803 <mml:mo>=</mml:mo>
804 <mml:mi>1.0</mml:mi>
805 </mml:mrow>
806 </mml:math></div>
807 </td></tr><tr><td align="left">
808 <code class="constant">GL_NEVER</code>
809 </td><td align="left">
810 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
811 <mml:mrow>
812 <mml:mi mathvariant="italic">result</mml:mi>
813 <mml:mo>=</mml:mo>
814 <mml:mi>0.0</mml:mi>
815 </mml:mrow>
816 </mml:math></div>
817 </td></tr></tbody></table></div><p>
818 where <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math>
819 is the current interpolated texture coordinate, and
820 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
821
822 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
823 <mml:mi mathvariant="italic">t</mml:mi>
824 </mml:msub>
825 </mml:math>
826 is the depth texture value sampled from the currently bound depth texture.
827 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">result</mml:mi></mml:math>
828 is assigned to the either the luminance, intensity, or alpha (as
829 specified by <code class="constant">GL_DEPTH_TEXTURE_MODE</code>.)
830 </p></dd><dt><span class="term"><code class="constant">GL_DEPTH_TEXTURE_MODE</code></span></dt><dd><p>
831 Specifies a single symbolic constant indicating how depth values should be
832 treated during filtering and texture application. Accepted values are
833 <code class="constant">GL_LUMINANCE</code>, <code class="constant">GL_INTENSITY</code>, and <code class="constant">GL_ALPHA</code>. The initial value
834 is <code class="constant">GL_LUMINANCE</code>.
835 </p></dd><dt><span class="term"><code class="constant">GL_GENERATE_MIPMAP</code></span></dt><dd><p>
836 Specifies a boolean value that indicates if all levels of a mipmap array
837 should be automatically updated when any modification to the base level
838 mipmap is done. The initial value is <code class="constant">GL_FALSE</code>.
839 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
840 <code class="constant">GL_TEXTURE_3D</code>, <code class="constant">GL_TEXTURE_MIN_LOD</code>, <code class="constant">GL_TEXTURE_MAX_LOD</code>,
841 <code class="constant">GL_CLAMP_TO_EDGE</code>, <code class="constant">GL_TEXTURE_BASE_LEVEL</code>, and <code class="constant">GL_TEXTURE_MAX_LEVEL</code> are
842 available only if the GL version is 1.2 or greater.
843 </p><p>
844 <code class="constant">GL_CLAMP_TO_BORDER</code> is available only if the GL version is 1.3 or greater.
845 </p><p>
846 <code class="constant">GL_MIRRORED_REPEAT</code>, <code class="constant">GL_TEXTURE_COMPARE_MODE</code>,
847 <code class="constant">GL_TEXTURE_COMPARE_FUNC</code>, <code class="constant">GL_DEPTH_TEXTURE_MODE</code>, and
848 <code class="constant">GL_GENERATE_MIPMAP</code> are available only if the GL version is 1.4 or
849 greater.
850 </p><p>
851 <code class="constant">GL_TEXTURE_COMPARE_FUNC</code> allows the following additional comparison modes only
852 if the GL version is 1.5 or greater:
853 <code class="constant">GL_LESS</code>, <code class="constant">GL_GREATER</code>,
854 <code class="constant">GL_EQUAL</code>, <code class="constant">GL_NOTEQUAL</code>,
855 <code class="constant">GL_ALWAYS</code>, and <code class="constant">GL_NEVER</code>.
856 </p><p>
857 Suppose that a program has enabled texturing (by calling <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> with
858 argument <code class="constant">GL_TEXTURE_1D</code>, <code class="constant">GL_TEXTURE_2D</code>, or <code class="constant">GL_TEXTURE_3D</code>) and
859 has set <code class="constant">GL_TEXTURE_MIN_FILTER</code> to one of the functions that requires a
860 mipmap. If either the dimensions of the texture images currently defined
861 (with previous calls to <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, <a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
862 <a class="citerefentry" href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, <a class="citerefentry" href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, or <a class="citerefentry" href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>) do not
863 follow the proper sequence for mipmaps (described above), or there are
864 fewer texture images defined than are needed, or the set of texture images
865 have differing numbers of texture components, then it is as if texture
866 mapping were disabled.
867 </p><p>
868 Linear filtering accesses the four nearest texture elements only in 2D
869 textures. In 1D textures, linear filtering accesses the two nearest
870 texture elements.
871 </p><p>
872 For OpenGL versions 1.3 and greater, or when the <code class="code">ARB_multitexture</code> extension is supported, <code class="function">glTexParameter</code>
873 specifies the texture parameters for the active texture unit, specified
874 by calling <a class="citerefentry" href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
875 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
876 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> or <em class="parameter"><code>pname</code></em> is not
877 one of the accepted defined values.
878 </p><p>
879 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>params</code></em> should have a defined
880 constant value (based on the value of <em class="parameter"><code>pname</code></em>) and does not.
881 </p><p>
882 <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glTexParameter</code> is executed between the
883 execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
884 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
885 <a class="citerefentry" href="glGetTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexParameter</span></span></a>
886 </p><p>
887 <a class="citerefentry" href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>
888 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
889 <a class="citerefentry" href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
890 <a class="citerefentry" href="glBindTexture.xml"><span class="citerefentry"><span class="refentrytitle">glBindTexture</span></span></a>,
891 <a class="citerefentry" href="glCopyPixels.xml"><span class="citerefentry"><span class="refentrytitle">glCopyPixels</span></span></a>,
892 <a class="citerefentry" href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
893 <a class="citerefentry" href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
894 <a class="citerefentry" href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
895 <a class="citerefentry" href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
896 <a class="citerefentry" href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>,
897 <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>,
898 <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
899 <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>,
900 <a class="citerefentry" href="glPrioritizeTextures.xml"><span class="citerefentry"><span class="refentrytitle">glPrioritizeTextures</span></span></a>,
901 <a class="citerefentry" href="glTexEnv.xml"><span class="citerefentry"><span class="refentrytitle">glTexEnv</span></span></a>,
902 <a class="citerefentry" href="glTexGen.xml"><span class="citerefentry"><span class="refentrytitle">glTexGen</span></span></a>,
903 <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>,
904 <a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
905 <a class="citerefentry" href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
906 <a class="citerefentry" href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
907 <a class="citerefentry" href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
908 <a class="citerefentry" href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>
909 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
910 Copyright <span class="trademark"></span>© 1991-2006
911 Silicon Graphics, Inc. This document is licensed under the SGI
912 Free Software B License. For details, see
913 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
914 </p></div></div></body></html>