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