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