include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / man3 / glTexParameter.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="glTexParameter">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glTexParameter</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glTexParameter</refname>
17 <refpurpose>set texture parameters</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glTexParameterf</function></funcdef>
23 <paramdef>GLenum <parameter>target</parameter></paramdef>
24 <paramdef>GLenum <parameter>pname</parameter></paramdef>
25 <paramdef>GLfloat <parameter>param</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 <funcsynopsis>
29 <funcprototype>
30 <funcdef>void <function>glTexParameteri</function></funcdef>
31 <paramdef>GLenum <parameter>target</parameter></paramdef>
32 <paramdef>GLenum <parameter>pname</parameter></paramdef>
33 <paramdef>GLint <parameter>param</parameter></paramdef>
34 </funcprototype>
35 </funcsynopsis>
36 </refsynopsisdiv>
37 <!-- eqn: ignoring delim $$ -->
38 <refsect1 id="parameters"><title>Parameters</title>
39 <variablelist>
40 <varlistentry>
41 <term><parameter>target</parameter></term>
42 <listitem>
43 <para>
44 Specifies the target texture,
45 which must be either <constant>GL_TEXTURE_1D</constant>, <constant>GL_TEXTURE_2D</constant>,
46 <constant>GL_TEXTURE_3D</constant>, <constant>GL_TEXTURE_1D_ARRAY</constant>,
47 <constant>GL_TEXTURE_2D_ARRAY</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>,
48 or <constant>GL_TEXTURE_CUBE_MAP</constant>.
49 </para>
50 </listitem>
51 </varlistentry>
52 <varlistentry>
53 <term><parameter>pname</parameter></term>
54 <listitem>
55 <para>
56 Specifies the symbolic name of a single-valued texture parameter.
57 <parameter>pname</parameter> can be one of the following:
58 <constant>GL_TEXTURE_BASE_LEVEL</constant>,
59 <constant>GL_TEXTURE_COMPARE_FUNC</constant>,
60 <constant>GL_TEXTURE_COMPARE_MODE</constant>,
61 <constant>GL_TEXTURE_LOD_BIAS</constant>,
62 <constant>GL_TEXTURE_MIN_FILTER</constant>,
63 <constant>GL_TEXTURE_MAG_FILTER</constant>,
64 <constant>GL_TEXTURE_MIN_LOD</constant>,
65 <constant>GL_TEXTURE_MAX_LOD</constant>,
66 <constant>GL_TEXTURE_MAX_LEVEL</constant>,
67 <constant>GL_TEXTURE_SWIZZLE_R</constant>,
68 <constant>GL_TEXTURE_SWIZZLE_G</constant>,
69 <constant>GL_TEXTURE_SWIZZLE_B</constant>,
70 <constant>GL_TEXTURE_SWIZZLE_A</constant>,
71 <constant>GL_TEXTURE_WRAP_S</constant>,
72 <constant>GL_TEXTURE_WRAP_T</constant>, or
73 <constant>GL_TEXTURE_WRAP_R</constant>.
74 </para>
75 </listitem>
76 </varlistentry>
77 <varlistentry>
78 <term><parameter>param</parameter></term>
79 <listitem>
80 <para>
81 Specifies the value of <parameter>pname</parameter>.
82 </para>
83 </listitem>
84 </varlistentry>
85 </variablelist>
86 </refsect1>
87 <refsynopsisdiv><title>C Specification</title>
88 <funcsynopsis>
89 <funcprototype>
90 <funcdef>void <function>glTexParameterfv</function></funcdef>
91 <paramdef>GLenum <parameter>target</parameter></paramdef>
92 <paramdef>GLenum <parameter>pname</parameter></paramdef>
93 <paramdef>const GLfloat * <parameter>params</parameter></paramdef>
94 </funcprototype>
95 </funcsynopsis>
96 <funcsynopsis>
97 <funcprototype>
98 <funcdef>void <function>glTexParameteriv</function></funcdef>
99 <paramdef>GLenum <parameter>target</parameter></paramdef>
100 <paramdef>GLenum <parameter>pname</parameter></paramdef>
101 <paramdef>const GLint * <parameter>params</parameter></paramdef>
102 </funcprototype>
103 </funcsynopsis>
104 <funcsynopsis>
105 <funcprototype>
106 <funcdef>void <function>glTexParameterIiv</function></funcdef>
107 <paramdef>GLenum <parameter>target</parameter></paramdef>
108 <paramdef>GLenum <parameter>pname</parameter></paramdef>
109 <paramdef>const GLint * <parameter>params</parameter></paramdef>
110 </funcprototype>
111 </funcsynopsis>
112 <funcsynopsis>
113 <funcprototype>
114 <funcdef>void <function>glTexParameterIuiv</function></funcdef>
115 <paramdef>GLenum <parameter>target</parameter></paramdef>
116 <paramdef>GLenum <parameter>pname</parameter></paramdef>
117 <paramdef>const GLuint * <parameter>params</parameter></paramdef>
118 </funcprototype>
119 </funcsynopsis>
120 </refsynopsisdiv>
121 <refsect1 id="parameters2"><title>Parameters</title>
122 <variablelist>
123 <varlistentry>
124 <term><parameter>target</parameter></term>
125 <listitem>
126 <para>
127 Specifies the target texture,
128 which must be either <constant>GL_TEXTURE_1D</constant>, <constant>GL_TEXTURE_2D</constant>,
129 <constant>GL_TEXTURE_3D</constant>, <constant>GL_TEXTURE_1D_ARRAY</constant>,
130 <constant>GL_TEXTURE_2D_ARRAY</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>,
131 or <constant>GL_TEXTURE_CUBE_MAP</constant>.
132 </para>
133 </listitem>
134 </varlistentry>
135 <varlistentry>
136 <term><parameter>pname</parameter></term>
137 <listitem>
138 <para>
139 Specifies the symbolic name of a texture parameter.
140 <parameter>pname</parameter> can be one of the following:
141 <constant>GL_TEXTURE_BASE_LEVEL</constant>,
142 <constant>GL_TEXTURE_BORDER_COLOR</constant>,
143 <constant>GL_TEXTURE_COMPARE_FUNC</constant>,
144 <constant>GL_TEXTURE_COMPARE_MODE</constant>,
145 <constant>GL_TEXTURE_LOD_BIAS</constant>,
146 <constant>GL_TEXTURE_MIN_FILTER</constant>,
147 <constant>GL_TEXTURE_MAG_FILTER</constant>,
148 <constant>GL_TEXTURE_MIN_LOD</constant>,
149 <constant>GL_TEXTURE_MAX_LOD</constant>,
150 <constant>GL_TEXTURE_MAX_LEVEL</constant>,
151 <constant>GL_TEXTURE_SWIZZLE_R</constant>,
152 <constant>GL_TEXTURE_SWIZZLE_G</constant>,
153 <constant>GL_TEXTURE_SWIZZLE_B</constant>,
154 <constant>GL_TEXTURE_SWIZZLE_A</constant>,
155 <constant>GL_TEXTURE_SWIZZLE_RGBA</constant>,
156 <constant>GL_TEXTURE_WRAP_S</constant>,
157 <constant>GL_TEXTURE_WRAP_T</constant>, or
158 <constant>GL_TEXTURE_WRAP_R</constant>.
159 </para>
160 </listitem>
161 </varlistentry>
162 <varlistentry>
163 <term><parameter>params</parameter></term>
164 <listitem>
165 <para>
166 Specifies a pointer to an array where the value or values of <parameter>pname</parameter>
167 are stored.
168 </para>
169 </listitem>
170 </varlistentry>
171 </variablelist>
172 </refsect1>
173 <refsect1 id="description"><title>Description</title>
174 <para>
175 <function>glTexParameter</function> assigns the value or values in <parameter>params</parameter> to the texture parameter
176 specified as <parameter>pname</parameter>.
177 <parameter>target</parameter> defines the target texture,
178 either <constant>GL_TEXTURE_1D</constant>, <constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_1D_ARRAY</constant>,
179 <constant>GL_TEXTURE_2D_ARRAY</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>, or <constant>GL_TEXTURE_3D</constant>.
180 The following symbols are accepted in <parameter>pname</parameter>:
181 </para>
182 <variablelist>
183 <varlistentry>
184 <term><constant>GL_TEXTURE_BASE_LEVEL</constant></term>
185 <listitem>
186 <para>
187 Specifies the index of the lowest defined mipmap level. This is an
188 integer value. The initial value is 0.
189 </para>
190 </listitem>
191 </varlistentry>
192 </variablelist>
193 <para>
194 </para>
195 <variablelist>
196 <varlistentry>
197 <term><constant>GL_TEXTURE_BORDER_COLOR</constant></term>
198 <listitem>
199 <para>
200 The data in <parameter>params</parameter> specifies four values that define the border values that
201 should be used for border texels. If a texel is sampled from the border of the texture, the
202 values of <constant>GL_TEXTURE_BORDER_COLOR</constant> are interpreted as an RGBA color to match the
203 texture's internal format and substituted for the non-existent texel data. If the texture contains depth
204 components, the first component of <constant>GL_TEXTURE_BORDER_COLOR</constant> is interpreted as a depth value.
205 The initial value is
206 <inlineequation><mml:math>
207 <mml:mrow>
208 <mml:mfenced open="(" close=")">
209 <mml:mrow>
210 0.0, 0.0, 0.0, 0.0
211 </mml:mrow>
212 </mml:mfenced>
213 </mml:mrow>
214 </mml:math></inlineequation>.
215 </para>
216 <para>
217 If the values for <constant>GL_TEXTURE_BORDER_COLOR</constant> are specified with <function>glTexParameterIiv</function>
218 or <function>glTexParameterIuiv</function>, the values are stored unmodified with an internal data type of
219 integer. If specified with <function>glTexParameteriv</function>, they are converted to floating point with the following
220 equation:
221 <inlineequation><mml:math>
222 <mml:mrow>
223 <mml:mi mathvariant="italic">f</mml:mi>
224 <mml:mo>=</mml:mo>
225 <mml:mfrac>
226 <mml:mrow>
227 <mml:msub><mml:mn>2</mml:mn>
228 <mml:mi mathvariant="italic">c</mml:mi>
229 </mml:msub>
230 <mml:mo>+</mml:mo>
231 <mml:mn>1</mml:mn>
232 </mml:mrow>
233 <mml:mrow>
234 <mml:msup><mml:mn>2</mml:mn>
235 <mml:mi mathvariant="italic">b</mml:mi>
236 </mml:msup>
237 <mml:mo>-</mml:mo>
238 <mml:mn>1</mml:mn>
239 </mml:mrow>
240 </mml:mfrac>
241 </mml:mrow>
242 </mml:math></inlineequation>.
243 If specified with <function>glTexParameterfv</function>, they are stored unmodified as floating-point values.
244 </para>
245 </listitem>
246 </varlistentry>
247 <varlistentry>
248 <term><constant>GL_TEXTURE_COMPARE_FUNC</constant></term>
249 <listitem>
250 <para>
251 Specifies the comparison operator used when <constant>GL_TEXTURE_COMPARE_MODE</constant> is
252 set to <constant>GL_COMPARE_REF_TO_TEXTURE</constant>. Permissible values are:
253 <informaltable frame="topbot">
254 <tgroup cols="2" align="left">
255 <colspec/>
256 <colspec/>
257 <thead>
258 <row>
259 <entry rowsep="1" align="left"><emphasis role="bold">
260 Texture Comparison Function
261 </emphasis></entry>
262 <entry rowsep="1" align="left"><emphasis role="bold">
263 Computed result
264 </emphasis></entry>
265 </row>
266 </thead>
267 <tbody>
268 <row>
269 <entry align="left">
270 <constant>GL_LEQUAL</constant>
271 </entry>
272 <entry align="left">
273 <informalequation><mml:math>
274 <!-- eqn: result = left { cpile {1.0 above 0.0} lpile {r <= {D sub t} above r > {D sub t}}: -->
275 <mml:mrow>
276 <mml:mi mathvariant="italic">result</mml:mi>
277 <mml:mo>=</mml:mo>
278 <mml:mfenced open="{" close="">
279 <mml:mrow>
280 <mml:mtable>
281 <mml:mtr><mml:mtd>
282 <mml:mn>1.0</mml:mn>
283 </mml:mtd></mml:mtr>
284 <mml:mtr><mml:mtd>
285 <mml:mn>0.0</mml:mn>
286 </mml:mtd></mml:mtr>
287 </mml:mtable>
288 <mml:mo>&it;&nbsp;&nbsp;</mml:mo>
289 <mml:mtable>
290 <mml:mtr><mml:mtd>
291 <mml:mrow>
292 <mml:mi mathvariant="italic">r</mml:mi>
293 <mml:mo>&lt;=</mml:mo>
294 <mml:mfenced open="" close="">
295 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
296 <mml:mi mathvariant="italic">t</mml:mi>
297 </mml:msub>
298 </mml:mfenced>
299 </mml:mrow>
300 </mml:mtd></mml:mtr>
301 <mml:mtr><mml:mtd>
302 <mml:mrow>
303 <mml:mi mathvariant="italic">r</mml:mi>
304 <mml:mo>&gt;</mml:mo>
305 <mml:mfenced open="" close="">
306 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
307 <mml:mi mathvariant="italic">t</mml:mi>
308 </mml:msub>
309 </mml:mfenced>
310 </mml:mrow>
311 </mml:mtd></mml:mtr>
312 </mml:mtable>
313 </mml:mrow>
314 </mml:mfenced>
315 </mml:mrow>
316 </mml:math></informalequation>
317 </entry>
318 </row>
319 <row>
320 <entry align="left">
321 <constant>GL_GEQUAL</constant>
322 </entry>
323 <entry align="left">
324 <informalequation><mml:math>
325 <!-- eqn: result = left { cpile {1.0 above 0.0} lpile {r <= {D sub t} above r > {D sub t}}: -->
326 <mml:mrow>
327 <mml:mi mathvariant="italic">result</mml:mi>
328 <mml:mo>=</mml:mo>
329 <mml:mfenced open="{" close="">
330 <mml:mrow>
331 <mml:mtable>
332 <mml:mtr><mml:mtd>
333 <mml:mn>1.0</mml:mn>
334 </mml:mtd></mml:mtr>
335 <mml:mtr><mml:mtd>
336 <mml:mn>0.0</mml:mn>
337 </mml:mtd></mml:mtr>
338 </mml:mtable>
339 <mml:mo>&it;&nbsp;&nbsp;</mml:mo>
340 <mml:mtable>
341 <mml:mtr><mml:mtd>
342 <mml:mrow>
343 <mml:mi mathvariant="italic">r</mml:mi>
344 <mml:mo>&gt;=</mml:mo>
345 <mml:mfenced open="" close="">
346 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
347 <mml:mi mathvariant="italic">t</mml:mi>
348 </mml:msub>
349 </mml:mfenced>
350 </mml:mrow>
351 </mml:mtd></mml:mtr>
352 <mml:mtr><mml:mtd>
353 <mml:mrow>
354 <mml:mi mathvariant="italic">r</mml:mi>
355 <mml:mo>&lt;</mml:mo>
356 <mml:mfenced open="" close="">
357 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
358 <mml:mi mathvariant="italic">t</mml:mi>
359 </mml:msub>
360 </mml:mfenced>
361 </mml:mrow>
362 </mml:mtd></mml:mtr>
363 </mml:mtable>
364 </mml:mrow>
365 </mml:mfenced>
366 </mml:mrow>
367 </mml:math></informalequation>
368 </entry>
369 </row>
370 <row>
371 <entry align="left">
372 <constant>GL_LESS</constant>
373 </entry>
374 <entry align="left">
375 <informalequation><mml:math>
376 <!-- eqn: result = left { cpile {1.0 above 0.0} lpile {r <= {D sub t} above r > {D sub t}}: -->
377 <mml:mrow>
378 <mml:mi mathvariant="italic">result</mml:mi>
379 <mml:mo>=</mml:mo>
380 <mml:mfenced open="{" close="">
381 <mml:mrow>
382 <mml:mtable>
383 <mml:mtr><mml:mtd>
384 <mml:mn>1.0</mml:mn>
385 </mml:mtd></mml:mtr>
386 <mml:mtr><mml:mtd>
387 <mml:mn>0.0</mml:mn>
388 </mml:mtd></mml:mtr>
389 </mml:mtable>
390 <mml:mo>&it;&nbsp;&nbsp;</mml:mo>
391 <mml:mtable>
392 <mml:mtr><mml:mtd>
393 <mml:mrow>
394 <mml:mi mathvariant="italic">r</mml:mi>
395 <mml:mo>&lt;</mml:mo>
396 <mml:mfenced open="" close="">
397 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
398 <mml:mi mathvariant="italic">t</mml:mi>
399 </mml:msub>
400 </mml:mfenced>
401 </mml:mrow>
402 </mml:mtd></mml:mtr>
403 <mml:mtr><mml:mtd>
404 <mml:mrow>
405 <mml:mi mathvariant="italic">r</mml:mi>
406 <mml:mo>&gt;=</mml:mo>
407 <mml:mfenced open="" close="">
408 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
409 <mml:mi mathvariant="italic">t</mml:mi>
410 </mml:msub>
411 </mml:mfenced>
412 </mml:mrow>
413 </mml:mtd></mml:mtr>
414 </mml:mtable>
415 </mml:mrow>
416 </mml:mfenced>
417 </mml:mrow>
418 </mml:math></informalequation>
419 </entry>
420 </row>
421 <row>
422 <entry align="left">
423 <constant>GL_GREATER</constant>
424 </entry>
425 <entry align="left">
426 <informalequation><mml:math>
427 <!-- eqn: result = left { cpile {1.0 above 0.0} lpile {r <= {D sub t} above r > {D sub t}}: -->
428 <mml:mrow>
429 <mml:mi mathvariant="italic">result</mml:mi>
430 <mml:mo>=</mml:mo>
431 <mml:mfenced open="{" close="">
432 <mml:mrow>
433 <mml:mtable>
434 <mml:mtr><mml:mtd>
435 <mml:mn>1.0</mml:mn>
436 </mml:mtd></mml:mtr>
437 <mml:mtr><mml:mtd>
438 <mml:mn>0.0</mml:mn>
439 </mml:mtd></mml:mtr>
440 </mml:mtable>
441 <mml:mo>&it;&nbsp;&nbsp;</mml:mo>
442 <mml:mtable>
443 <mml:mtr><mml:mtd>
444 <mml:mrow>
445 <mml:mi mathvariant="italic">r</mml:mi>
446 <mml:mo>&gt;</mml:mo>
447 <mml:mfenced open="" close="">
448 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
449 <mml:mi mathvariant="italic">t</mml:mi>
450 </mml:msub>
451 </mml:mfenced>
452 </mml:mrow>
453 </mml:mtd></mml:mtr>
454 <mml:mtr><mml:mtd>
455 <mml:mrow>
456 <mml:mi mathvariant="italic">r</mml:mi>
457 <mml:mo>&lt;=</mml:mo>
458 <mml:mfenced open="" close="">
459 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
460 <mml:mi mathvariant="italic">t</mml:mi>
461 </mml:msub>
462 </mml:mfenced>
463 </mml:mrow>
464 </mml:mtd></mml:mtr>
465 </mml:mtable>
466 </mml:mrow>
467 </mml:mfenced>
468 </mml:mrow>
469 </mml:math></informalequation>
470 </entry>
471 </row>
472 <row>
473 <entry align="left">
474 <constant>GL_EQUAL</constant>
475 </entry>
476 <entry align="left">
477 <informalequation><mml:math>
478 <!-- eqn: result = left { cpile {1.0 above 0.0} lpile {r <= {D sub t} above r > {D sub t}}: -->
479 <mml:mrow>
480 <mml:mi mathvariant="italic">result</mml:mi>
481 <mml:mo>=</mml:mo>
482 <mml:mfenced open="{" close="">
483 <mml:mrow>
484 <mml:mtable>
485 <mml:mtr><mml:mtd>
486 <mml:mn>1.0</mml:mn>
487 </mml:mtd></mml:mtr>
488 <mml:mtr><mml:mtd>
489 <mml:mn>0.0</mml:mn>
490 </mml:mtd></mml:mtr>
491 </mml:mtable>
492 <mml:mo>&it;&nbsp;&nbsp;</mml:mo>
493 <mml:mtable>
494 <mml:mtr><mml:mtd>
495 <mml:mrow>
496 <mml:mi mathvariant="italic">r</mml:mi>
497 <mml:mo>=</mml:mo>
498 <mml:mfenced open="" close="">
499 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
500 <mml:mi mathvariant="italic">t</mml:mi>
501 </mml:msub>
502 </mml:mfenced>
503 </mml:mrow>
504 </mml:mtd></mml:mtr>
505 <mml:mtr><mml:mtd>
506 <mml:mrow>
507 <mml:mi mathvariant="italic">r</mml:mi>
508 <mml:mo>&ne;</mml:mo>
509 <mml:mfenced open="" close="">
510 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
511 <mml:mi mathvariant="italic">t</mml:mi>
512 </mml:msub>
513 </mml:mfenced>
514 </mml:mrow>
515 </mml:mtd></mml:mtr>
516 </mml:mtable>
517 </mml:mrow>
518 </mml:mfenced>
519 </mml:mrow>
520 </mml:math></informalequation>
521 </entry>
522 </row>
523 <row>
524 <entry align="left">
525 <constant>GL_NOTEQUAL</constant>
526 </entry>
527 <entry align="left">
528 <informalequation><mml:math>
529 <!-- eqn: result = left { cpile {1.0 above 0.0} lpile {r <= {D sub t} above r > {D sub t}}: -->
530 <mml:mrow>
531 <mml:mi mathvariant="italic">result</mml:mi>
532 <mml:mo>=</mml:mo>
533 <mml:mfenced open="{" close="">
534 <mml:mrow>
535 <mml:mtable>
536 <mml:mtr><mml:mtd>
537 <mml:mn>1.0</mml:mn>
538 </mml:mtd></mml:mtr>
539 <mml:mtr><mml:mtd>
540 <mml:mn>0.0</mml:mn>
541 </mml:mtd></mml:mtr>
542 </mml:mtable>
543 <mml:mo>&it;&nbsp;&nbsp;</mml:mo>
544 <mml:mtable>
545 <mml:mtr><mml:mtd>
546 <mml:mrow>
547 <mml:mi mathvariant="italic">r</mml:mi>
548 <mml:mo>&ne;</mml:mo>
549 <mml:mfenced open="" close="">
550 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
551 <mml:mi mathvariant="italic">t</mml:mi>
552 </mml:msub>
553 </mml:mfenced>
554 </mml:mrow>
555 </mml:mtd></mml:mtr>
556 <mml:mtr><mml:mtd>
557 <mml:mrow>
558 <mml:mi mathvariant="italic">r</mml:mi>
559 <mml:mo>=</mml:mo>
560 <mml:mfenced open="" close="">
561 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
562 <mml:mi mathvariant="italic">t</mml:mi>
563 </mml:msub>
564 </mml:mfenced>
565 </mml:mrow>
566 </mml:mtd></mml:mtr>
567 </mml:mtable>
568 </mml:mrow>
569 </mml:mfenced>
570 </mml:mrow>
571 </mml:math></informalequation>
572 </entry>
573 </row>
574 <row>
575 <entry align="left">
576 <constant>GL_ALWAYS</constant>
577 </entry>
578 <entry align="left">
579 <informalequation>
580 <mml:math>
581 <mml:mrow>
582 <mml:mi mathvariant="italic">result</mml:mi>
583 <mml:mo>=</mml:mo>
584 <mml:mi>1.0</mml:mi>
585 </mml:mrow>
586 </mml:math>
587 </informalequation>
588 </entry>
589 </row>
590 <row>
591 <entry align="left">
592 <constant>GL_NEVER</constant>
593 </entry>
594 <entry align="left">
595 <informalequation>
596 <mml:math>
597 <mml:mrow>
598 <mml:mi mathvariant="italic">result</mml:mi>
599 <mml:mo>=</mml:mo>
600 <mml:mi>0.0</mml:mi>
601 </mml:mrow>
602 </mml:math>
603 </informalequation>
604 </entry>
605 </row>
606 </tbody>
607 </tgroup>
608 </informaltable>
609 where <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation>
610 is the current interpolated texture coordinate, and
611 <inlineequation><mml:math>
612 <!-- eqn: D sub t: -->
613 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
614 <mml:mi mathvariant="italic">t</mml:mi>
615 </mml:msub>
616 </mml:math></inlineequation>
617 is the depth texture value sampled from the currently bound depth texture.
618 <inlineequation><mml:math><mml:mi mathvariant="italic">result</mml:mi></mml:math></inlineequation>
619 is assigned to the the red channel.
620 </para>
621 </listitem>
622 </varlistentry>
623 <varlistentry>
624 <term><constant>GL_TEXTURE_COMPARE_MODE</constant></term>
625 <listitem>
626 <para>
627 Specifies the texture comparison mode for currently bound depth textures.
628 That is, a texture whose internal format is <constant>GL_DEPTH_COMPONENT_*</constant>; see
629 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>)
630 Permissible values are:
631 <variablelist>
632 <varlistentry>
633 <term><constant>GL_COMPARE_REF_TO_TEXTURE</constant></term>
634 <listitem>
635 <para>
636 Specifies that the interpolated and clamped
637 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation>
638 texture coordinate should
639 be compared to the value in the currently bound depth texture. See the
640 discussion of <constant>GL_TEXTURE_COMPARE_FUNC</constant> for details of how the comparison
641 is evaluated. The result of the comparison is assigned to the red channel.
642 </para>
643 </listitem>
644 </varlistentry>
645 <varlistentry>
646 <term><constant>GL_NONE</constant></term>
647 <listitem>
648 <para>
649 Specifies that the red channel should be assigned the
650 appropriate value from the currently bound depth texture.
651 </para>
652 </listitem>
653 </varlistentry>
654 </variablelist>
655 </para>
656 </listitem>
657 </varlistentry>
658 <varlistentry>
659 <term><constant>GL_TEXTURE_LOD_BIAS</constant></term>
660 <listitem>
661 <para>
662 <parameter>params</parameter> specifies a fixed bias value that is to be added to the level-of-detail
663 parameter for the texture before texture sampling. The specified value is added to the shader-supplied
664 bias value (if any) and subsequently clamped into the implementation-defined range
665 <inlineequation><mml:math>
666 <mml:mfenced open="[" close="]">
667 <mml:mfenced open="" close="">
668 <mml:mrow>
669 -
670 <mml:msub><mml:mi mathvariant="italic">bias</mml:mi>
671 <mml:mi mathvariant="italic">max</mml:mi>
672 </mml:msub>
673 </mml:mrow>
674 </mml:mfenced>
675 <mml:mrow>
676 <mml:mfenced open="" close="">
677 <mml:mrow>
678 <mml:msub><mml:mi mathvariant="italic">bias</mml:mi>
679 <mml:mi mathvariant="italic">max</mml:mi>
680 </mml:msub>
681 </mml:mrow>
682 </mml:mfenced>
683 </mml:mrow>
684 </mml:mfenced>
685 </mml:math></inlineequation>,
686 where
687 <inlineequation><mml:math>
688 <mml:mrow>
689 <mml:msub><mml:mi mathvariant="italic">bias</mml:mi>
690 <mml:mi mathvariant="italic">max</mml:mi>
691 </mml:msub>
692 </mml:mrow>
693 </mml:math></inlineequation>
694 is the value of the implementation defined constant <constant>GL_MAX_TEXTURE_LOD_BIAS</constant>. The initial value is 0.0.
695 </para>
696 </listitem>
697 </varlistentry>
698 <varlistentry>
699 <term><constant>GL_TEXTURE_MIN_FILTER</constant></term>
700 <listitem>
701 <para>
702 The texture minifying function is used whenever the level-of-detail function
703 used when sampling from the texture determines that the texture should be minified.
704 There are six defined minifying functions.
705 Two of them use either the nearest texture elements or a weighted average of multiple texture elements
706 to compute the texture value.
707 The other four use mipmaps.
708 </para>
709 <para>
710 A mipmap is an ordered set of arrays representing the same image
711 at progressively lower resolutions.
712 If the texture has dimensions
713 <inlineequation><mml:math>
714 <!-- eqn: 2 sup n times 2 sup m: -->
715 <mml:mrow>
716 <mml:msup><mml:mn>2</mml:mn>
717 <mml:mi mathvariant="italic">n</mml:mi>
718 </mml:msup>
719 <mml:mo>&times;</mml:mo>
720 <mml:msup><mml:mn>2</mml:mn>
721 <mml:mi mathvariant="italic">m</mml:mi>
722 </mml:msup>
723 </mml:mrow>
724 </mml:math></inlineequation>,
725 there are
726 <inlineequation><mml:math>
727 <!-- eqn: max ( n, m ) + 1: -->
728 <mml:mrow>
729 <mml:mrow>
730 <mml:mi mathvariant="italic">max</mml:mi>
731 <mml:mo>&af;</mml:mo>
732 <mml:mfenced open="(" close=")">
733 <mml:mi mathvariant="italic">n</mml:mi>
734 <mml:mi mathvariant="italic">m</mml:mi>
735 </mml:mfenced>
736 </mml:mrow>
737 <mml:mo>+</mml:mo>
738 <mml:mn>1</mml:mn>
739 </mml:mrow>
740 </mml:math></inlineequation>
741 mipmaps.
742 The first mipmap is the original texture,
743 with dimensions
744 <inlineequation><mml:math>
745 <!-- eqn: 2 sup n times 2 sup m: -->
746 <mml:mrow>
747 <mml:msup><mml:mn>2</mml:mn>
748 <mml:mi mathvariant="italic">n</mml:mi>
749 </mml:msup>
750 <mml:mo>&times;</mml:mo>
751 <mml:msup><mml:mn>2</mml:mn>
752 <mml:mi mathvariant="italic">m</mml:mi>
753 </mml:msup>
754 </mml:mrow>
755 </mml:math></inlineequation>.
756 Each subsequent mipmap has dimensions
757 <inlineequation><mml:math>
758 <!-- eqn: 2 sup { k - 1 } times 2 sup { l - 1 }: -->
759 <mml:mrow>
760 <mml:msup><mml:mn>2</mml:mn>
761 <mml:mfenced open="" close="">
762 <mml:mrow>
763 <mml:mi mathvariant="italic">k</mml:mi>
764 <mml:mo>-</mml:mo>
765 <mml:mn>1</mml:mn>
766 </mml:mrow>
767 </mml:mfenced>
768 </mml:msup>
769 <mml:mo>&times;</mml:mo>
770 <mml:msup><mml:mn>2</mml:mn>
771 <mml:mfenced open="" close="">
772 <mml:mrow>
773 <mml:mi mathvariant="italic">l</mml:mi>
774 <mml:mo>-</mml:mo>
775 <mml:mn>1</mml:mn>
776 </mml:mrow>
777 </mml:mfenced>
778 </mml:msup>
779 </mml:mrow>
780 </mml:math></inlineequation>,
781 where
782 <inlineequation><mml:math>
783 <!-- eqn: 2 sup k times 2 sup l: -->
784 <mml:mrow>
785 <mml:msup><mml:mn>2</mml:mn>
786 <mml:mi mathvariant="italic">k</mml:mi>
787 </mml:msup>
788 <mml:mo>&times;</mml:mo>
789 <mml:msup><mml:mn>2</mml:mn>
790 <mml:mi mathvariant="italic">l</mml:mi>
791 </mml:msup>
792 </mml:mrow>
793 </mml:math></inlineequation>
794 are the dimensions of the previous mipmap,
795 until either
796 <inlineequation><mml:math>
797 <!-- eqn: k = 0: -->
798 <mml:mrow>
799 <mml:mi mathvariant="italic">k</mml:mi>
800 <mml:mo>=</mml:mo>
801 <mml:mn>0</mml:mn>
802 </mml:mrow>
803 </mml:math></inlineequation>
804 or
805 <inlineequation><mml:math>
806 <!-- eqn: l = 0: -->
807 <mml:mrow>
808 <mml:mi mathvariant="italic">l</mml:mi>
809 <mml:mo>=</mml:mo>
810 <mml:mn>0</mml:mn>
811 </mml:mrow>
812 </mml:math></inlineequation>.
813 At that point,
814 subsequent mipmaps have dimension
815 <inlineequation><mml:math>
816 <!-- eqn: 1 times 2 sup { l - 1 }: -->
817 <mml:mrow>
818 <mml:mn>1</mml:mn>
819 <mml:mo>&times;</mml:mo>
820 <mml:msup><mml:mn>2</mml:mn>
821 <mml:mfenced open="" close="">
822 <mml:mrow>
823 <mml:mi mathvariant="italic">l</mml:mi>
824 <mml:mo>-</mml:mo>
825 <mml:mn>1</mml:mn>
826 </mml:mrow>
827 </mml:mfenced>
828 </mml:msup>
829 </mml:mrow>
830 </mml:math></inlineequation>
831 or
832 <inlineequation><mml:math>
833 <!-- eqn: 2 sup { k - 1} times 1: -->
834 <mml:mrow>
835 <mml:msup><mml:mn>2</mml:mn>
836 <mml:mfenced open="" close="">
837 <mml:mrow>
838 <mml:mi mathvariant="italic">k</mml:mi>
839 <mml:mo>-</mml:mo>
840 <mml:mn>1</mml:mn>
841 </mml:mrow>
842 </mml:mfenced>
843 </mml:msup>
844 <mml:mo>&times;</mml:mo>
845 <mml:mn>1</mml:mn>
846 </mml:mrow>
847 </mml:math></inlineequation>
848 until the final mipmap,
849 which has dimension
850 <inlineequation><mml:math>
851 <!-- eqn: 1 times 1: -->
852 <mml:mrow>
853 <mml:mn>1</mml:mn>
854 <mml:mo>&times;</mml:mo>
855 <mml:mn>1</mml:mn>
856 </mml:mrow>
857 </mml:math></inlineequation>.
858 To define the mipmaps, call <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
859 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
860 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>, or <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>
861 with the <emphasis>level</emphasis> argument indicating the order of the mipmaps.
862 Level 0 is the original texture;
863 level
864 <inlineequation><mml:math>
865 <!-- eqn: max ( n, m ): -->
866 <mml:mrow>
867 <mml:mi mathvariant="italic">max</mml:mi>
868 <mml:mo>&af;</mml:mo>
869 <mml:mfenced open="(" close=")">
870 <mml:mi mathvariant="italic">n</mml:mi>
871 <mml:mi mathvariant="italic">m</mml:mi>
872 </mml:mfenced>
873 </mml:mrow>
874 </mml:math></inlineequation>
875 is the final
876 <inlineequation><mml:math>
877 <!-- eqn: 1 times 1: -->
878 <mml:mrow>
879 <mml:mn>1</mml:mn>
880 <mml:mo>&times;</mml:mo>
881 <mml:mn>1</mml:mn>
882 </mml:mrow>
883 </mml:math></inlineequation>
884 mipmap.
885 </para>
886 <para>
887 <parameter>params</parameter> supplies a function for minifying the texture as one of the
888 following:
889 <variablelist>
890 <varlistentry>
891 <term><constant>GL_NEAREST</constant></term>
892 <listitem>
893 <para>
894 Returns the value of the texture element that is nearest
895 (in Manhattan distance)
896 to the specified texture coordinates.
897 </para>
898 </listitem>
899 </varlistentry>
900 <varlistentry>
901 <term><constant>GL_LINEAR</constant></term>
902 <listitem>
903 <para>
904 Returns the weighted average of the four texture elements
905 that are closest to the specified texture coordinates.
906 These can include items wrapped or repeated from other parts of a texture,
907 depending on the values of <constant>GL_TEXTURE_WRAP_S</constant> and <constant>GL_TEXTURE_WRAP_T</constant>,
908 and on the exact mapping.
909 </para>
910 </listitem>
911 </varlistentry>
912 <varlistentry>
913 <term><constant>GL_NEAREST_MIPMAP_NEAREST</constant></term>
914 <listitem>
915 <para>
916 Chooses the mipmap that most closely matches the size of the pixel
917 being textured and uses the <constant>GL_NEAREST</constant> criterion
918 (the texture element closest to the specified texture coordinates)
919 to produce a texture value.
920 </para>
921 </listitem>
922 </varlistentry>
923 <varlistentry>
924 <term><constant>GL_LINEAR_MIPMAP_NEAREST</constant></term>
925 <listitem>
926 <para>
927 Chooses the mipmap that most closely matches the size of the pixel
928 being textured and uses the <constant>GL_LINEAR</constant> criterion
929 (a weighted average of the four texture elements that are closest to the specified texture coordinates)
930 to produce a texture value.
931 </para>
932 </listitem>
933 </varlistentry>
934 <varlistentry>
935 <term><constant>GL_NEAREST_MIPMAP_LINEAR</constant></term>
936 <listitem>
937 <para>
938 Chooses the two mipmaps that most closely match the size of the pixel
939 being textured and uses the <constant>GL_NEAREST</constant> criterion
940 (the texture element closest to the specified texture coordinates )
941 to produce a texture value from each mipmap.
942 The final texture value is a weighted average of those two values.
943 </para>
944 </listitem>
945 </varlistentry>
946 <varlistentry>
947 <term><constant>GL_LINEAR_MIPMAP_LINEAR</constant></term>
948 <listitem>
949 <para>
950 Chooses the two mipmaps that most closely match the size of the pixel
951 being textured and uses the <constant>GL_LINEAR</constant> criterion
952 (a weighted average of the texture elements that are closest to the specified texture coordinates)
953 to produce a texture value from each mipmap.
954 The final texture value is a weighted average of those two values.
955 </para>
956 </listitem>
957 </varlistentry>
958 </variablelist>
959 </para>
960 <para>
961 As more texture elements are sampled in the minification process,
962 fewer aliasing artifacts will be apparent.
963 While the <constant>GL_NEAREST</constant> and <constant>GL_LINEAR</constant> minification functions can be
964 faster than the other four,
965 they sample only one or multiple texture elements to determine the texture value
966 of the pixel being rendered and can produce moire patterns
967 or ragged transitions.
968 The initial value of <constant>GL_TEXTURE_MIN_FILTER</constant> is
969 <constant>GL_NEAREST_MIPMAP_LINEAR</constant>.
970 </para>
971 </listitem>
972 </varlistentry>
973 </variablelist>
974 <para>
975 </para>
976 <variablelist>
977 <varlistentry>
978 <term><constant>GL_TEXTURE_MAG_FILTER</constant></term>
979 <listitem>
980 <para>
981 The texture magnification function is used whenever the level-of-detail function
982 used when sampling from the texture determines that the texture should be magified.
983 It sets the texture magnification function to either <constant>GL_NEAREST</constant>
984 or <constant>GL_LINEAR</constant> (see below). <constant>GL_NEAREST</constant> is generally faster
985 than <constant>GL_LINEAR</constant>,
986 but it can produce textured images with sharper edges
987 because the transition between texture elements is not as smooth.
988 The initial value of <constant>GL_TEXTURE_MAG_FILTER</constant> is <constant>GL_LINEAR</constant>.
989 <variablelist>
990 <varlistentry>
991 <term><constant>GL_NEAREST</constant></term>
992 <listitem>
993 <para>
994 Returns the value of the texture element that is nearest
995 (in Manhattan distance)
996 to the specified texture coordinates.
997 </para>
998 </listitem>
999 </varlistentry>
1000 <varlistentry>
1001 <term><constant>GL_LINEAR</constant></term>
1002 <listitem>
1003 <para>
1004 Returns the weighted average of the texture elements
1005 that are closest to the specified texture coordinates.
1006 These can include items wrapped or repeated from other parts of a texture,
1007 depending on the values of <constant>GL_TEXTURE_WRAP_S</constant> and <constant>GL_TEXTURE_WRAP_T</constant>,
1008 and on the exact mapping.
1009 </para>
1010 </listitem>
1011 </varlistentry>
1012 </variablelist>
1013 <para>
1014 </para>
1015 </para>
1016 </listitem>
1017 </varlistentry>
1018 </variablelist>
1019 <para>
1020 </para>
1021 <variablelist>
1022 <varlistentry>
1023 <term><constant>GL_TEXTURE_MIN_LOD</constant></term>
1024 <listitem>
1025 <para>
1026 Sets the minimum level-of-detail parameter. This floating-point value
1027 limits the selection of highest resolution mipmap (lowest mipmap
1028 level). The initial value is -1000.
1029 </para>
1030 </listitem>
1031 </varlistentry>
1032 </variablelist>
1033 <para>
1034 </para>
1035 <variablelist>
1036 <varlistentry>
1037 <term><constant>GL_TEXTURE_MAX_LOD</constant></term>
1038 <listitem>
1039 <para>
1040 Sets the maximum level-of-detail parameter. This floating-point value
1041 limits the selection of the lowest resolution mipmap (highest mipmap
1042 level). The initial value is 1000.
1043 </para>
1044 </listitem>
1045 </varlistentry>
1046 </variablelist>
1047 <para>
1048 </para>
1049 <variablelist>
1050 <varlistentry>
1051 <term><constant>GL_TEXTURE_MAX_LEVEL</constant></term>
1052 <listitem>
1053 <para>
1054 Sets the index of the highest defined mipmap level. This is an integer
1055 value. The initial value is 1000.
1056 </para>
1057 </listitem>
1058 </varlistentry>
1059 </variablelist>
1060 <para>
1061 </para>
1062 <variablelist>
1063 <varlistentry>
1064 <term><constant>GL_TEXTURE_SWIZZLE_R</constant></term>
1065 <listitem>
1066 <para>
1067 Sets the swizzle that will be applied to the <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation>
1068 component of a texel before it is returned to the shader. Valid values for <parameter>param</parameter> are <constant>GL_RED</constant>,
1069 <constant>GL_GREEN</constant>, <constant>GL_BLUE</constant>, <constant>GL_ALPHA</constant>, <constant>GL_ZERO</constant> and
1070 <constant>GL_ONE</constant>.
1071 If <constant>GL_TEXTURE_SWIZZLE_R</constant> is <constant>GL_RED</constant>, the value for
1072 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation> will be taken from the first
1073 channel of the fetched texel.
1074 If <constant>GL_TEXTURE_SWIZZLE_R</constant> is <constant>GL_GREEN</constant>, the value for
1075 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation> will be taken from the second
1076 channel of the fetched texel.
1077 If <constant>GL_TEXTURE_SWIZZLE_R</constant> is <constant>GL_BLUE</constant>, the value for
1078 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation> will be taken from the third
1079 channel of the fetched texel.
1080 If <constant>GL_TEXTURE_SWIZZLE_R</constant> is <constant>GL_ALPHA</constant>, the value for
1081 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation> will be taken from the fourth
1082 channel of the fetched texel.
1083 If <constant>GL_TEXTURE_SWIZZLE_R</constant> is <constant>GL_ZERO</constant>, the value for
1084 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation> will be subtituted with
1085 <inlineequation><mml:math><mml:mn>0.0</mml:mn></mml:math></inlineequation>.
1086 If <constant>GL_TEXTURE_SWIZZLE_R</constant> is <constant>GL_ONE</constant>, the value for
1087 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation> will be subtituted with
1088 <inlineequation><mml:math><mml:mn>1.0</mml:mn></mml:math></inlineequation>.
1089 The initial value is <constant>GL_RED</constant>.
1090 </para>
1091 </listitem>
1092 </varlistentry>
1093 </variablelist>
1094 <para>
1095 </para>
1096 <variablelist>
1097 <varlistentry>
1098 <term><constant>GL_TEXTURE_SWIZZLE_G</constant></term>
1099 <listitem>
1100 <para>
1101 Sets the swizzle that will be applied to the <inlineequation><mml:math><mml:mi mathvariant="italic">g</mml:mi></mml:math></inlineequation>
1102 component of a texel before it is returned to the shader. Valid values for <parameter>param</parameter> and their effects are similar to
1103 those of <constant>GL_TEXTURE_SWIZZLE_R</constant>.
1104 The initial value is <constant>GL_GREEN</constant>.
1105 </para>
1106 </listitem>
1107 </varlistentry>
1108 </variablelist>
1109 <para>
1110 </para>
1111 <variablelist>
1112 <varlistentry>
1113 <term><constant>GL_TEXTURE_SWIZZLE_B</constant></term>
1114 <listitem>
1115 <para>
1116 Sets the swizzle that will be applied to the <inlineequation><mml:math><mml:mi mathvariant="italic">b</mml:mi></mml:math></inlineequation>
1117 component of a texel before it is returned to the shader. Valid values for <parameter>param</parameter> and their effects are similar to
1118 those of <constant>GL_TEXTURE_SWIZZLE_R</constant>.
1119 The initial value is <constant>GL_BLUE</constant>.
1120 </para>
1121 </listitem>
1122 </varlistentry>
1123 </variablelist>
1124 <para>
1125 </para>
1126 <variablelist>
1127 <varlistentry>
1128 <term><constant>GL_TEXTURE_SWIZZLE_A</constant></term>
1129 <listitem>
1130 <para>
1131 Sets the swizzle that will be applied to the <inlineequation><mml:math><mml:mi mathvariant="italic">a</mml:mi></mml:math></inlineequation>
1132 component of a texel before it is returned to the shader. Valid values for <parameter>param</parameter> and their effects are similar to
1133 those of <constant>GL_TEXTURE_SWIZZLE_R</constant>.
1134 The initial value is <constant>GL_ALPHA</constant>.
1135 </para>
1136 </listitem>
1137 </varlistentry>
1138 </variablelist>
1139 <para>
1140 </para>
1141 <variablelist>
1142 <varlistentry>
1143 <term><constant>GL_TEXTURE_SWIZZLE_RGBA</constant></term>
1144 <listitem>
1145 <para>
1146 Sets the swizzles that will be applied to the
1147 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation>,
1148 <inlineequation><mml:math><mml:mi mathvariant="italic">g</mml:mi></mml:math></inlineequation>,
1149 <inlineequation><mml:math><mml:mi mathvariant="italic">b</mml:mi></mml:math></inlineequation>, and
1150 <inlineequation><mml:math><mml:mi mathvariant="italic">a</mml:mi></mml:math></inlineequation>
1151 components of a texel before they are returned to the shader. Valid values for <parameter>params</parameter> and their effects are similar to
1152 those of <constant>GL_TEXTURE_SWIZZLE_R</constant>, except that all channels are specified simultaneously.
1153 Setting the value of <constant>GL_TEXTURE_SWIZZLE_RGBA</constant> is equivalent (assuming no errors are generated) to
1154 setting the parameters of each of <constant>GL_TEXTURE_SWIZZLE_R</constant>,
1155 <constant>GL_TEXTURE_SWIZZLE_G</constant>,
1156 <constant>GL_TEXTURE_SWIZZLE_B</constant>, and
1157 <constant>GL_TEXTURE_SWIZZLE_A</constant> successively.
1158 </para>
1159 </listitem>
1160 </varlistentry>
1161 </variablelist>
1162 <para>
1163 </para>
1164 <variablelist>
1165 <varlistentry>
1166 <term><constant>GL_TEXTURE_WRAP_S</constant></term>
1167 <listitem>
1168 <para>
1169 Sets the wrap parameter for texture coordinate
1170 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
1171 to either <constant>GL_CLAMP_TO_EDGE</constant>, <constant>GL_CLAMP_TO_BORDER</constant>,
1172 <constant>GL_MIRRORED_REPEAT</constant>, or
1173 <constant>GL_REPEAT</constant>. <constant>GL_CLAMP_TO_EDGE</constant> causes
1174 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
1175 coordinates to be clamped to the
1176 range
1177 <inlineequation><mml:math>
1178 <!-- eqn: left [ {1 over 2N}, 1 - {1 over 2N} right ]: -->
1179 <mml:mfenced open="[" close="]">
1180 <mml:mfenced open="" close="">
1181 <mml:mrow>
1182 <mml:mfrac>
1183 <mml:mn>1</mml:mn>
1184 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
1185 </mml:mfrac>
1186 </mml:mrow>
1187 </mml:mfenced>
1188 <mml:mrow>
1189 <mml:mn>1</mml:mn>
1190 <mml:mo>-</mml:mo>
1191 <mml:mfenced open="" close="">
1192 <mml:mrow>
1193 <mml:mfrac>
1194 <mml:mn>1</mml:mn>
1195 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
1196 </mml:mfrac>
1197 </mml:mrow>
1198 </mml:mfenced>
1199 </mml:mrow>
1200 </mml:mfenced>
1201 </mml:math></inlineequation>,
1202 where
1203 <inlineequation><mml:math><mml:mi mathvariant="italic">N</mml:mi></mml:math></inlineequation>
1204 is the size
1205 of the texture in the direction of clamping.
1206 <constant>GL_CLAMP_TO_BORDER</constant> evaluates <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation> coordinates in a similar manner to <constant>GL_CLAMP_TO_EDGE</constant>.
1207 However, in cases where clamping would have occurred in <constant>GL_CLAMP_TO_EDGE</constant> mode, the fetched texel data
1208 is substituted with the values specified by <constant>GL_TEXTURE_BORDER_COLOR</constant>.
1209 <constant>GL_REPEAT</constant> causes the
1210 integer part of the
1211 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
1212 coordinate to be ignored; the GL uses only the
1213 fractional part, thereby creating a repeating pattern.
1214 <constant>GL_MIRRORED_REPEAT</constant> causes the
1215 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
1216 coordinate to be set to the
1217 fractional part of the texture coordinate if the integer part of
1218 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
1219 is
1220 even; if the integer part of
1221 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
1222 is odd, then the
1223 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
1224 texture coordinate is
1225 set to
1226 <inlineequation><mml:math>
1227 <!-- eqn: 1 - frac(s): -->
1228 <mml:mrow>
1229 <mml:mn>1</mml:mn>
1230 <mml:mo>-</mml:mo>
1231 <mml:mrow>
1232 <mml:mi mathvariant="italic">frac</mml:mi>
1233 <mml:mo>&af;</mml:mo>
1234 <mml:mfenced open="(" close=")">
1235 <mml:mi mathvariant="italic">s</mml:mi>
1236 </mml:mfenced>
1237 </mml:mrow>
1238 </mml:mrow>
1239 </mml:math></inlineequation>,
1240 where
1241 <inlineequation><mml:math>
1242 <!-- eqn: frac(s): -->
1243 <mml:mrow>
1244 <mml:mi mathvariant="italic">frac</mml:mi>
1245 <mml:mo>&af;</mml:mo>
1246 <mml:mfenced open="(" close=")">
1247 <mml:mi mathvariant="italic">s</mml:mi>
1248 </mml:mfenced>
1249 </mml:mrow>
1250 </mml:math></inlineequation>
1251 represents the fractional part of
1252 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>.
1253 Initially, <constant>GL_TEXTURE_WRAP_S</constant> is set to <constant>GL_REPEAT</constant>.
1254 </para>
1255 </listitem>
1256 </varlistentry>
1257 </variablelist>
1258 <para>
1259 </para>
1260 <variablelist>
1261 <varlistentry>
1262 <term><constant>GL_TEXTURE_WRAP_T</constant></term>
1263 <listitem>
1264 <para>
1265 Sets the wrap parameter for texture coordinate
1266 <inlineequation><mml:math><mml:mi mathvariant="italic">t</mml:mi></mml:math></inlineequation>
1267 to either <constant>GL_CLAMP_TO_EDGE</constant>, <constant>GL_CLAMP_TO_BORDER</constant>,
1268 <constant>GL_MIRRORED_REPEAT</constant>, or
1269 <constant>GL_REPEAT</constant>. See the discussion under <constant>GL_TEXTURE_WRAP_S</constant>.
1270 Initially, <constant>GL_TEXTURE_WRAP_T</constant> is set to <constant>GL_REPEAT</constant>.
1271 </para>
1272 </listitem>
1273 </varlistentry>
1274 </variablelist>
1275 <para>
1276 </para>
1277 <variablelist>
1278 <varlistentry>
1279 <term><constant>GL_TEXTURE_WRAP_R</constant></term>
1280 <listitem>
1281 <para>
1282 Sets the wrap parameter for texture coordinate
1283 <inlineequation><mml:math><mml:mi mathvariant="italic">r</mml:mi></mml:math></inlineequation>
1284 to either <constant>GL_CLAMP_TO_EDGE</constant>, <constant>GL_CLAMP_TO_BORDER</constant>,
1285 <constant>GL_MIRRORED_REPEAT</constant>, or
1286 <constant>GL_REPEAT</constant>. See the discussion under <constant>GL_TEXTURE_WRAP_S</constant>.
1287 Initially, <constant>GL_TEXTURE_WRAP_R</constant> is set to <constant>GL_REPEAT</constant>.
1288 </para>
1289 </listitem>
1290 </varlistentry>
1291 </variablelist>
1292 </refsect1>
1293 <refsect1 id="notes"><title>Notes</title>
1294 <para>
1295 Suppose that a program attempts to sample from a texture and
1296 has set <constant>GL_TEXTURE_MIN_FILTER</constant> to one of the functions that requires a
1297 mipmap. If either the dimensions of the texture images currently defined
1298 (with previous calls to <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
1299 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>, or <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>) do not
1300 follow the proper sequence for mipmaps (described above), or there are
1301 fewer texture images defined than are needed, or the set of texture images
1302 have differing numbers of texture components, then the texture is considered <emphasis>incomplete</emphasis>.
1303 </para>
1304 <para>
1305 Linear filtering accesses the four nearest texture elements only in 2D
1306 textures. In 1D textures, linear filtering accesses the two nearest
1307 texture elements. In 3D textures, linear filtering accesses the eight nearest
1308 texture elements.
1309 </para>
1310 <para>
1311 <function>glTexParameter</function> specifies the texture parameters for the active texture unit, specified
1312 by calling <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>.
1313 </para>
1314 </refsect1>
1315 <refsect1 id="errors"><title>Errors</title>
1316 <para>
1317 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> or <parameter>pname</parameter> is not
1318 one of the accepted defined values.
1319 </para>
1320 <para>
1321 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>params</parameter> should have a defined
1322 constant value (based on the value of <parameter>pname</parameter>) and does not.
1323 </para>
1324 </refsect1>
1325 <refsect1 id="associatedgets"><title>Associated Gets</title>
1326 <para>
1327 <citerefentry><refentrytitle>glGetTexParameter</refentrytitle></citerefentry>
1328 </para>
1329 <para>
1330 <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>
1331 </para>
1332 </refsect1>
1333 <refsect1 id="seealso"><title>See Also</title>
1334 <para>
1335 <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
1336 <citerefentry><refentrytitle>glBindTexture</refentrytitle></citerefentry>,
1337 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
1338 <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
1339 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
1340 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
1341 <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
1342 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
1343 <citerefentry><refentrytitle>glSamplerParameter</refentrytitle></citerefentry>,
1344 <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
1345 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
1346 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
1347 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
1348 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
1349 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>
1350 </para>
1351 </refsect1>
1352 <refsect1 id="Copyright"><title>Copyright</title>
1353 <para>
1354 Copyright <trademark class="copyright"></trademark> 1991-2006
1355 Silicon Graphics, Inc. This document is licensed under the SGI
1356 Free Software B License. For details, see
1357 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
1358 </para>
1359 </refsect1>
1360 </refentry>