rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / xhtml / glSamplerParameter.xml
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>glSamplerParameter - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glSamplerParameter"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glSamplerParameter — set sampler 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">glSamplerParameterf</b>(</code></td><td>GLuint  </td><td><var class="pdparam">sampler</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">glSamplerParameteri</b>(</code></td><td>GLuint  </td><td><var class="pdparam">sampler</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>sampler</code></em></span></dt><dd><p>
5 Specifies the sampler object whose parameter to modify.
6 </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p>
7 Specifies the symbolic name of a single-valued sampler parameter.
8 <em class="parameter"><code>pname</code></em> can be one of the following:
9 <code class="constant">GL_TEXTURE_WRAP_S</code>,
10 <code class="constant">GL_TEXTURE_WRAP_T</code>,
11 <code class="constant">GL_TEXTURE_WRAP_R</code>,
12 <code class="constant">GL_TEXTURE_MIN_FILTER</code>,
13 <code class="constant">GL_TEXTURE_MAG_FILTER</code>,
14 <code class="constant">GL_TEXTURE_MIN_LOD</code>,
15 <code class="constant">GL_TEXTURE_MAX_LOD</code>,
16 <code class="constant">GL_TEXTURE_LOD_BIAS</code>
17 <code class="constant">GL_TEXTURE_COMPARE_MODE</code>, or
18 <code class="constant">GL_TEXTURE_COMPARE_FUNC</code>.
19 </p></dd><dt><span class="term"><em class="parameter"><code>param</code></em></span></dt><dd><p>
20 Specifies the value of <em class="parameter"><code>pname</code></em>.
21 </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">glSamplerParameterfv</b>(</code></td><td>GLuint  </td><td><var class="pdparam">sampler</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">glSamplerParameteriv</b>(</code></td><td>GLuint  </td><td><var class="pdparam">sampler</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">glSamplerParameterIiv</b>(</code></td><td>GLuint  </td><td><var class="pdparam">sampler</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">glSamplerParameterIuiv</b>(</code></td><td>GLuint  </td><td><var class="pdparam">sampler</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>sampler</code></em></span></dt><dd><p>
22 Specifies the sampler object whose parameter to modify.
23 </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p>
24 Specifies the symbolic name of a sampler parameter.
25 <em class="parameter"><code>pname</code></em> can be one of the following:
26 <code class="constant">GL_TEXTURE_WRAP_S</code>,
27 <code class="constant">GL_TEXTURE_WRAP_T</code>,
28 <code class="constant">GL_TEXTURE_WRAP_R</code>,
29 <code class="constant">GL_TEXTURE_MIN_FILTER</code>,
30 <code class="constant">GL_TEXTURE_MAG_FILTER</code>,
31 <code class="constant">GL_TEXTURE_BORDER_COLOR</code>,
32 <code class="constant">GL_TEXTURE_MIN_LOD</code>,
33 <code class="constant">GL_TEXTURE_MAX_LOD</code>,
34 <code class="constant">GL_TEXTURE_LOD_BIAS</code>
35 <code class="constant">GL_TEXTURE_COMPARE_MODE</code>, or
36 <code class="constant">GL_TEXTURE_COMPARE_FUNC</code>.
37 </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p>
38 Specifies a pointer to an array where the value or values of <em class="parameter"><code>pname</code></em>
39 are stored.
40 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
41 <code class="function">glSamplerParameter</code> assigns the value or values in <em class="parameter"><code>params</code></em> to the sampler parameter
42 specified as <em class="parameter"><code>pname</code></em>.
43 <em class="parameter"><code>sampler</code></em> specifies the sampler object to be modified, and must be the name of a sampler object previously
44 returned from a call to <a href="glGenSamplers.xml"><span class="citerefentry"><span class="refentrytitle">glGenSamplers</span></span></a>.
45 The following symbols are accepted in <em class="parameter"><code>pname</code></em>:
46 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_MIN_FILTER</code></span></dt><dd><p>
47 The texture minifying function is used whenever the pixel being textured
48 maps to an area greater than one texture element.
49 There are six defined minifying functions.
50 Two of them use the nearest one or nearest four texture elements
51 to compute the texture value.
52 The other four use mipmaps.
53 </p><p>
54 A mipmap is an ordered set of arrays representing the same image
55 at progressively lower resolutions.
56 If the texture has dimensions
57 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
58
59 <mml:mrow>
60 <mml:msup><mml:mn>2</mml:mn>
61 <mml:mi mathvariant="italic">n</mml:mi>
62 </mml:msup>
63 <mml:mo>×</mml:mo>
64 <mml:msup><mml:mn>2</mml:mn>
65 <mml:mi mathvariant="italic">m</mml:mi>
66 </mml:msup>
67 </mml:mrow>
68 </mml:math>,
69 there are
70 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
71
72 <mml:mrow>
73 <mml:mrow>
74 <mml:mi mathvariant="italic">max</mml:mi>
75 <mml:mo></mml:mo>
76 <mml:mfenced open="(" close=")">
77 <mml:mi mathvariant="italic">n</mml:mi>
78 <mml:mi mathvariant="italic">m</mml:mi>
79 </mml:mfenced>
80 </mml:mrow>
81 <mml:mo>+</mml:mo>
82 <mml:mn>1</mml:mn>
83 </mml:mrow>
84 </mml:math>
85 mipmaps.
86 The first mipmap is the original texture,
87 with dimensions
88 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
89
90 <mml:mrow>
91 <mml:msup><mml:mn>2</mml:mn>
92 <mml:mi mathvariant="italic">n</mml:mi>
93 </mml:msup>
94 <mml:mo>×</mml:mo>
95 <mml:msup><mml:mn>2</mml:mn>
96 <mml:mi mathvariant="italic">m</mml:mi>
97 </mml:msup>
98 </mml:mrow>
99 </mml:math>.
100 Each subsequent mipmap has dimensions
101 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
102
103 <mml:mrow>
104 <mml:msup><mml:mn>2</mml:mn>
105 <mml:mfenced open="" close="">
106 <mml:mrow>
107 <mml:mi mathvariant="italic">k</mml:mi>
108 <mml:mo>-</mml:mo>
109 <mml:mn>1</mml:mn>
110 </mml:mrow>
111 </mml:mfenced>
112 </mml:msup>
113 <mml:mo>×</mml:mo>
114 <mml:msup><mml:mn>2</mml:mn>
115 <mml:mfenced open="" close="">
116 <mml:mrow>
117 <mml:mi mathvariant="italic">l</mml:mi>
118 <mml:mo>-</mml:mo>
119 <mml:mn>1</mml:mn>
120 </mml:mrow>
121 </mml:mfenced>
122 </mml:msup>
123 </mml:mrow>
124 </mml:math>,
125 where
126 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
127
128 <mml:mrow>
129 <mml:msup><mml:mn>2</mml:mn>
130 <mml:mi mathvariant="italic">k</mml:mi>
131 </mml:msup>
132 <mml:mo>×</mml:mo>
133 <mml:msup><mml:mn>2</mml:mn>
134 <mml:mi mathvariant="italic">l</mml:mi>
135 </mml:msup>
136 </mml:mrow>
137 </mml:math>
138 are the dimensions of the previous mipmap,
139 until either
140 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
141
142 <mml:mrow>
143 <mml:mi mathvariant="italic">k</mml:mi>
144 <mml:mo>=</mml:mo>
145 <mml:mn>0</mml:mn>
146 </mml:mrow>
147 </mml:math>
148 or
149 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
150
151 <mml:mrow>
152 <mml:mi mathvariant="italic">l</mml:mi>
153 <mml:mo>=</mml:mo>
154 <mml:mn>0</mml:mn>
155 </mml:mrow>
156 </mml:math>.
157 At that point,
158 subsequent mipmaps have dimension
159 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
160
161 <mml:mrow>
162 <mml:mn>1</mml:mn>
163 <mml:mo>×</mml:mo>
164 <mml:msup><mml:mn>2</mml:mn>
165 <mml:mfenced open="" close="">
166 <mml:mrow>
167 <mml:mi mathvariant="italic">l</mml:mi>
168 <mml:mo>-</mml:mo>
169 <mml:mn>1</mml:mn>
170 </mml:mrow>
171 </mml:mfenced>
172 </mml:msup>
173 </mml:mrow>
174 </mml:math>
175 or
176 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
177
178 <mml:mrow>
179 <mml:msup><mml:mn>2</mml:mn>
180 <mml:mfenced open="" close="">
181 <mml:mrow>
182 <mml:mi mathvariant="italic">k</mml:mi>
183 <mml:mo>-</mml:mo>
184 <mml:mn>1</mml:mn>
185 </mml:mrow>
186 </mml:mfenced>
187 </mml:msup>
188 <mml:mo>×</mml:mo>
189 <mml:mn>1</mml:mn>
190 </mml:mrow>
191 </mml:math>
192 until the final mipmap,
193 which has dimension
194 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
195
196 <mml:mrow>
197 <mml:mn>1</mml:mn>
198 <mml:mo>×</mml:mo>
199 <mml:mn>1</mml:mn>
200 </mml:mrow>
201 </mml:math>.
202 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>,
203 <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
204 <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>
205 with the <span class="emphasis"><em>level</em></span> argument indicating the order of the mipmaps.
206 Level 0 is the original texture;
207 level
208 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
209
210 <mml:mrow>
211 <mml:mi mathvariant="italic">max</mml:mi>
212 <mml:mo></mml:mo>
213 <mml:mfenced open="(" close=")">
214 <mml:mi mathvariant="italic">n</mml:mi>
215 <mml:mi mathvariant="italic">m</mml:mi>
216 </mml:mfenced>
217 </mml:mrow>
218 </mml:math>
219 is the final
220 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
221
222 <mml:mrow>
223 <mml:mn>1</mml:mn>
224 <mml:mo>×</mml:mo>
225 <mml:mn>1</mml:mn>
226 </mml:mrow>
227 </mml:math>
228 mipmap.
229 </p><p>
230 <em class="parameter"><code>params</code></em> supplies a function for minifying the texture as one of the
231 following:
232 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_NEAREST</code></span></dt><dd><p>
233 Returns the value of the texture element that is nearest
234 (in Manhattan distance)
235 to the center of the pixel being textured.
236 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR</code></span></dt><dd><p>
237 Returns the weighted average of the four texture elements
238 that are closest to the center of the pixel being textured.
239 These can include border texture elements,
240 depending on the values of <code class="constant">GL_TEXTURE_WRAP_S</code> and <code class="constant">GL_TEXTURE_WRAP_T</code>,
241 and on the exact mapping.
242 </p></dd><dt><span class="term"><code class="constant">GL_NEAREST_MIPMAP_NEAREST</code></span></dt><dd><p>
243 Chooses the mipmap that most closely matches the size of the pixel
244 being textured and uses the <code class="constant">GL_NEAREST</code> criterion
245 (the texture element nearest to the center of the pixel)
246 to produce a texture value.
247 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR_MIPMAP_NEAREST</code></span></dt><dd><p>
248 Chooses the mipmap that most closely matches the size of the pixel
249 being textured and uses the <code class="constant">GL_LINEAR</code> criterion
250 (a weighted average of the four texture elements that are closest
251 to the center of the pixel)
252 to produce a texture value.
253 </p></dd><dt><span class="term"><code class="constant">GL_NEAREST_MIPMAP_LINEAR</code></span></dt><dd><p>
254 Chooses the two mipmaps that most closely match the size of the pixel
255 being textured and uses the <code class="constant">GL_NEAREST</code> criterion
256 (the texture element nearest to the center of the pixel)
257 to produce a texture value from each mipmap.
258 The final texture value is a weighted average of those two values.
259 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR_MIPMAP_LINEAR</code></span></dt><dd><p>
260 Chooses the two mipmaps that most closely match the size of the pixel
261 being textured and uses the <code class="constant">GL_LINEAR</code> criterion
262 (a weighted average of the four texture elements that are closest
263 to the center of the pixel)
264 to produce a texture value from each mipmap.
265 The final texture value is a weighted average of those two values.
266 </p></dd></dl></div><p>
267 </p><p>
268 As more texture elements are sampled in the minification process,
269 fewer aliasing artifacts will be apparent.
270 While the <code class="constant">GL_NEAREST</code> and <code class="constant">GL_LINEAR</code> minification functions can be
271 faster than the other four,
272 they sample only one or four texture elements to determine the texture value
273 of the pixel being rendered and can produce moire patterns
274 or ragged transitions.
275 The initial value of <code class="constant">GL_TEXTURE_MIN_FILTER</code> is
276 <code class="constant">GL_NEAREST_MIPMAP_LINEAR</code>.
277 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_MAG_FILTER</code></span></dt><dd><p>
278 The texture magnification function is used when the pixel being textured
279 maps to an area less than or equal to one texture element.
280 It sets the texture magnification function to either <code class="constant">GL_NEAREST</code>
281 or <code class="constant">GL_LINEAR</code> (see below). <code class="constant">GL_NEAREST</code> is generally faster
282 than <code class="constant">GL_LINEAR</code>,
283 but it can produce textured images with sharper edges
284 because the transition between texture elements is not as smooth.
285 The initial value of <code class="constant">GL_TEXTURE_MAG_FILTER</code> is <code class="constant">GL_LINEAR</code>.
286 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_NEAREST</code></span></dt><dd><p>
287 Returns the value of the texture element that is nearest
288 (in Manhattan distance)
289 to the center of the pixel being textured.
290 </p></dd><dt><span class="term"><code class="constant">GL_LINEAR</code></span></dt><dd><p>
291 Returns the weighted average of the four texture elements
292 that are closest to the center of the pixel being textured.
293 These can include border texture elements,
294 depending on the values of <code class="constant">GL_TEXTURE_WRAP_S</code> and <code class="constant">GL_TEXTURE_WRAP_T</code>,
295 and on the exact mapping.
296 </p></dd></dl></div><p>
297 </p><p>
298 </p><p>
299 </p></dd></dl></div><p>
300 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_MIN_LOD</code></span></dt><dd><p>
301 Sets the minimum level-of-detail parameter. This floating-point value
302 limits the selection of highest resolution mipmap (lowest mipmap
303 level). The initial value is -1000.
304 </p></dd></dl></div><p>
305 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_MAX_LOD</code></span></dt><dd><p>
306 Sets the maximum level-of-detail parameter. This floating-point value
307 limits the selection of the lowest resolution mipmap (highest mipmap
308 level). The initial value is 1000.
309 </p></dd></dl></div><p>
310 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_WRAP_S</code></span></dt><dd><p>
311 Sets the wrap parameter for texture coordinate
312 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
313 to either <code class="constant">GL_CLAMP_TO_EDGE</code>, <code class="constant">GL_MIRRORED_REPEAT</code>, or
314 <code class="constant">GL_REPEAT</code>. <code class="constant">GL_CLAMP_TO_BORDER</code> causes the
315 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
316 coordinate to be clamped to the range
317 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
318
319 <mml:mfenced open="[" close="]">
320 <mml:mfenced open="" close="">
321 <mml:mrow>
322 <mml:mfrac>
323 <mml:mn>-1</mml:mn>
324 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
325 </mml:mfrac>
326 </mml:mrow>
327 </mml:mfenced>
328 <mml:mrow>
329 <mml:mn>1</mml:mn>
330 <mml:mo>+</mml:mo>
331 <mml:mfenced open="" close="">
332 <mml:mrow>
333 <mml:mfrac>
334 <mml:mn>1</mml:mn>
335 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
336 </mml:mfrac>
337 </mml:mrow>
338 </mml:mfenced>
339 </mml:mrow>
340 </mml:mfenced>
341 </mml:math>,
342 where
343 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math>
344 is the size of the texture in the direction of
345 clamping.<code class="constant">GL_CLAMP_TO_EDGE</code> causes
346 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
347 coordinates to be clamped to the
348 range
349 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
350
351 <mml:mfenced open="[" close="]">
352 <mml:mfenced open="" close="">
353 <mml:mrow>
354 <mml:mfrac>
355 <mml:mn>1</mml:mn>
356 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
357 </mml:mfrac>
358 </mml:mrow>
359 </mml:mfenced>
360 <mml:mrow>
361 <mml:mn>1</mml:mn>
362 <mml:mo>-</mml:mo>
363 <mml:mfenced open="" close="">
364 <mml:mrow>
365 <mml:mfrac>
366 <mml:mn>1</mml:mn>
367 <mml:mn>2<mml:mi mathvariant="italic">N</mml:mi></mml:mn>
368 </mml:mfrac>
369 </mml:mrow>
370 </mml:mfenced>
371 </mml:mrow>
372 </mml:mfenced>
373 </mml:math>,
374 where
375 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math>
376 is the size
377 of the texture in the direction of clamping. <code class="constant">GL_REPEAT</code> causes the
378 integer part of the
379 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
380 coordinate to be ignored; the GL uses only the
381 fractional part, thereby creating a repeating pattern.
382 <code class="constant">GL_MIRRORED_REPEAT</code> causes the
383 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
384 coordinate to be set to the
385 fractional part of the texture coordinate if the integer part of
386 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
387 is
388 even; if the integer part of
389 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
390 is odd, then the
391 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>
392 texture coordinate is
393 set to
394 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
395
396 <mml:mrow>
397 <mml:mn>1</mml:mn>
398 <mml:mo>-</mml:mo>
399 <mml:mrow>
400 <mml:mi mathvariant="italic">frac</mml:mi>
401 <mml:mo></mml:mo>
402 <mml:mfenced open="(" close=")">
403 <mml:mi mathvariant="italic">s</mml:mi>
404 </mml:mfenced>
405 </mml:mrow>
406 </mml:mrow>
407 </mml:math>,
408 where
409 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
410
411 <mml:mrow>
412 <mml:mi mathvariant="italic">frac</mml:mi>
413 <mml:mo></mml:mo>
414 <mml:mfenced open="(" close=")">
415 <mml:mi mathvariant="italic">s</mml:mi>
416 </mml:mfenced>
417 </mml:mrow>
418 </mml:math>
419 represents the fractional part of
420 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">s</mml:mi></mml:math>.
421 Initially, <code class="constant">GL_TEXTURE_WRAP_S</code> is set to <code class="constant">GL_REPEAT</code>.
422 </p></dd></dl></div><p>
423 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_TEXTURE_WRAP_T</code></span></dt><dd><p>
424 Sets the wrap parameter for texture coordinate
425 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">t</mml:mi></mml:math>
426 to either <code class="constant">GL_CLAMP_TO_EDGE</code>, <code class="constant">GL_MIRRORED_REPEAT</code>, or
427 <code class="constant">GL_REPEAT</code>. See the discussion under <code class="constant">GL_TEXTURE_WRAP_S</code>.
428 Initially, <code class="constant">GL_TEXTURE_WRAP_T</code> is set to <code class="constant">GL_REPEAT</code>.
429 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_WRAP_R</code></span></dt><dd><p>
430 Sets the wrap parameter for texture coordinate
431 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math>
432 to either <code class="constant">GL_CLAMP_TO_EDGE</code>, <code class="constant">GL_MIRRORED_REPEAT</code>, or
433 <code class="constant">GL_REPEAT</code>. See the discussion under <code class="constant">GL_TEXTURE_WRAP_S</code>.
434 Initially, <code class="constant">GL_TEXTURE_WRAP_R</code> is set to <code class="constant">GL_REPEAT</code>.
435 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_BORDER_COLOR</code></span></dt><dd><p>
436 The data in <em class="parameter"><code>params</code></em> specifies four values that define the border values that
437 should be used for border texels. If a texel is sampled from the border of the texture, the
438 values of <code class="constant">GL_TEXTURE_BORDER_COLOR</code> are interpreted as an RGBA color to match the
439 texture's internal format and substituted for the non-existent texel data. If the texture contains depth
440 components, the first component of <code class="constant">GL_TEXTURE_BORDER_COLOR</code> is interpreted as a depth value.
441 The initial value is
442 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
443 <mml:mrow>
444 <mml:mfenced open="(" close=")">
445 <mml:mrow>
446 <mml:mn>0.0</mml:mn>, <mml:mn>0.0</mml:mn>, <mml:mn>0.0</mml:mn>, <mml:mn>0.0</mml:mn>
447 </mml:mrow>
448 </mml:mfenced>
449 </mml:mrow>
450 </mml:math>.
451 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPARE_MODE</code></span></dt><dd><p>
452 Specifies the texture comparison mode for currently bound textures.
453 That is, a texture whose internal format is <code class="constant">GL_DEPTH_COMPONENT_*</code>; see
454 <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>)
455 Permissible values are:
456 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_COMPARE_REF_TO_TEXTURE</code></span></dt><dd><p>
457 Specifies that the interpolated and clamped
458 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math>
459 texture coordinate should
460 be compared to the value in the currently bound texture. See the
461 discussion of <code class="constant">GL_TEXTURE_COMPARE_FUNC</code> for details of how the comparison
462 is evaluated. The result of the comparison is assigned to the red channel.
463 </p></dd><dt><span class="term"><code class="constant">GL_NONE</code></span></dt><dd><p>
464 Specifies that the red channel should be assigned the
465 appropriate value from the currently bound texture.
466 </p></dd></dl></div><p>
467 </p></dd><dt><span class="term"><code class="constant">GL_TEXTURE_COMPARE_FUNC</code></span></dt><dd><p>
468 Specifies the comparison operator used when <code class="constant">GL_TEXTURE_COMPARE_MODE</code> is
469 set to <code class="constant">GL_COMPARE_REF_TO_TEXTURE</code>. Permissible values are:
470 </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
471 Texture Comparison Function
472 </strong></span></th><th align="left"><span class="bold"><strong>
473 Computed result
474 </strong></span></th></tr></thead><tbody><tr><td align="left">
475 <code class="constant">GL_LEQUAL</code>
476 </td><td align="left">
477 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
478
479 <mml:mrow>
480 <mml:mi mathvariant="italic">result</mml:mi>
481 <mml:mo>=</mml:mo>
482 <mml:mfenced open="{" close="">
483 <mml:mrow>
484 <mml:mtable>
485 <mml:mtr><mml:mtd>
486 <mml:mn>1.0</mml:mn>
487 </mml:mtd></mml:mtr>
488 <mml:mtr><mml:mtd>
489 <mml:mn>0.0</mml:mn>
490 </mml:mtd></mml:mtr>
491 </mml:mtable>
492 <mml:mo>⁢  </mml:mo>
493 <mml:mtable>
494 <mml:mtr><mml:mtd>
495 <mml:mrow>
496 <mml:mi mathvariant="italic">r</mml:mi>
497 <mml:mo>&lt;=</mml:mo>
498 <mml:mfenced open="" close="">
499 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
500 <mml:mi mathvariant="italic">t</mml:mi>
501 </mml:msub>
502 </mml:mfenced>
503 </mml:mrow>
504 </mml:mtd></mml:mtr>
505 <mml:mtr><mml:mtd>
506 <mml:mrow>
507 <mml:mi mathvariant="italic">r</mml:mi>
508 <mml:mo>&gt;</mml:mo>
509 <mml:mfenced open="" close="">
510 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
511 <mml:mi mathvariant="italic">t</mml:mi>
512 </mml:msub>
513 </mml:mfenced>
514 </mml:mrow>
515 </mml:mtd></mml:mtr>
516 </mml:mtable>
517 </mml:mrow>
518 </mml:mfenced>
519 </mml:mrow>
520 </mml:math></div>
521 </td></tr><tr><td align="left">
522 <code class="constant">GL_GEQUAL</code>
523 </td><td align="left">
524 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
525
526 <mml:mrow>
527 <mml:mi mathvariant="italic">result</mml:mi>
528 <mml:mo>=</mml:mo>
529 <mml:mfenced open="{" close="">
530 <mml:mrow>
531 <mml:mtable>
532 <mml:mtr><mml:mtd>
533 <mml:mn>1.0</mml:mn>
534 </mml:mtd></mml:mtr>
535 <mml:mtr><mml:mtd>
536 <mml:mn>0.0</mml:mn>
537 </mml:mtd></mml:mtr>
538 </mml:mtable>
539 <mml:mo>⁢  </mml:mo>
540 <mml:mtable>
541 <mml:mtr><mml:mtd>
542 <mml:mrow>
543 <mml:mi mathvariant="italic">r</mml:mi>
544 <mml:mo>&gt;=</mml:mo>
545 <mml:mfenced open="" close="">
546 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
547 <mml:mi mathvariant="italic">t</mml:mi>
548 </mml:msub>
549 </mml:mfenced>
550 </mml:mrow>
551 </mml:mtd></mml:mtr>
552 <mml:mtr><mml:mtd>
553 <mml:mrow>
554 <mml:mi mathvariant="italic">r</mml:mi>
555 <mml:mo>&lt;</mml:mo>
556 <mml:mfenced open="" close="">
557 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
558 <mml:mi mathvariant="italic">t</mml:mi>
559 </mml:msub>
560 </mml:mfenced>
561 </mml:mrow>
562 </mml:mtd></mml:mtr>
563 </mml:mtable>
564 </mml:mrow>
565 </mml:mfenced>
566 </mml:mrow>
567 </mml:math></div>
568 </td></tr><tr><td align="left">
569 <code class="constant">GL_LESS</code>
570 </td><td align="left">
571 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
572
573 <mml:mrow>
574 <mml:mi mathvariant="italic">result</mml:mi>
575 <mml:mo>=</mml:mo>
576 <mml:mfenced open="{" close="">
577 <mml:mrow>
578 <mml:mtable>
579 <mml:mtr><mml:mtd>
580 <mml:mn>1.0</mml:mn>
581 </mml:mtd></mml:mtr>
582 <mml:mtr><mml:mtd>
583 <mml:mn>0.0</mml:mn>
584 </mml:mtd></mml:mtr>
585 </mml:mtable>
586 <mml:mo>⁢  </mml:mo>
587 <mml:mtable>
588 <mml:mtr><mml:mtd>
589 <mml:mrow>
590 <mml:mi mathvariant="italic">r</mml:mi>
591 <mml:mo>&lt;</mml:mo>
592 <mml:mfenced open="" close="">
593 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
594 <mml:mi mathvariant="italic">t</mml:mi>
595 </mml:msub>
596 </mml:mfenced>
597 </mml:mrow>
598 </mml:mtd></mml:mtr>
599 <mml:mtr><mml:mtd>
600 <mml:mrow>
601 <mml:mi mathvariant="italic">r</mml:mi>
602 <mml:mo>&gt;=</mml:mo>
603 <mml:mfenced open="" close="">
604 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
605 <mml:mi mathvariant="italic">t</mml:mi>
606 </mml:msub>
607 </mml:mfenced>
608 </mml:mrow>
609 </mml:mtd></mml:mtr>
610 </mml:mtable>
611 </mml:mrow>
612 </mml:mfenced>
613 </mml:mrow>
614 </mml:math></div>
615 </td></tr><tr><td align="left">
616 <code class="constant">GL_GREATER</code>
617 </td><td align="left">
618 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
619
620 <mml:mrow>
621 <mml:mi mathvariant="italic">result</mml:mi>
622 <mml:mo>=</mml:mo>
623 <mml:mfenced open="{" close="">
624 <mml:mrow>
625 <mml:mtable>
626 <mml:mtr><mml:mtd>
627 <mml:mn>1.0</mml:mn>
628 </mml:mtd></mml:mtr>
629 <mml:mtr><mml:mtd>
630 <mml:mn>0.0</mml:mn>
631 </mml:mtd></mml:mtr>
632 </mml:mtable>
633 <mml:mo>⁢  </mml:mo>
634 <mml:mtable>
635 <mml:mtr><mml:mtd>
636 <mml:mrow>
637 <mml:mi mathvariant="italic">r</mml:mi>
638 <mml:mo>&gt;</mml:mo>
639 <mml:mfenced open="" close="">
640 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
641 <mml:mi mathvariant="italic">t</mml:mi>
642 </mml:msub>
643 </mml:mfenced>
644 </mml:mrow>
645 </mml:mtd></mml:mtr>
646 <mml:mtr><mml:mtd>
647 <mml:mrow>
648 <mml:mi mathvariant="italic">r</mml:mi>
649 <mml:mo>&lt;=</mml:mo>
650 <mml:mfenced open="" close="">
651 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
652 <mml:mi mathvariant="italic">t</mml:mi>
653 </mml:msub>
654 </mml:mfenced>
655 </mml:mrow>
656 </mml:mtd></mml:mtr>
657 </mml:mtable>
658 </mml:mrow>
659 </mml:mfenced>
660 </mml:mrow>
661 </mml:math></div>
662 </td></tr><tr><td align="left">
663 <code class="constant">GL_EQUAL</code>
664 </td><td align="left">
665 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
666
667 <mml:mrow>
668 <mml:mi mathvariant="italic">result</mml:mi>
669 <mml:mo>=</mml:mo>
670 <mml:mfenced open="{" close="">
671 <mml:mrow>
672 <mml:mtable>
673 <mml:mtr><mml:mtd>
674 <mml:mn>1.0</mml:mn>
675 </mml:mtd></mml:mtr>
676 <mml:mtr><mml:mtd>
677 <mml:mn>0.0</mml:mn>
678 </mml:mtd></mml:mtr>
679 </mml:mtable>
680 <mml:mo>⁢  </mml:mo>
681 <mml:mtable>
682 <mml:mtr><mml:mtd>
683 <mml:mrow>
684 <mml:mi mathvariant="italic">r</mml:mi>
685 <mml:mo>=</mml:mo>
686 <mml:mfenced open="" close="">
687 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
688 <mml:mi mathvariant="italic">t</mml:mi>
689 </mml:msub>
690 </mml:mfenced>
691 </mml:mrow>
692 </mml:mtd></mml:mtr>
693 <mml:mtr><mml:mtd>
694 <mml:mrow>
695 <mml:mi mathvariant="italic">r</mml:mi>
696 <mml:mo></mml:mo>
697 <mml:mfenced open="" close="">
698 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
699 <mml:mi mathvariant="italic">t</mml:mi>
700 </mml:msub>
701 </mml:mfenced>
702 </mml:mrow>
703 </mml:mtd></mml:mtr>
704 </mml:mtable>
705 </mml:mrow>
706 </mml:mfenced>
707 </mml:mrow>
708 </mml:math></div>
709 </td></tr><tr><td align="left">
710 <code class="constant">GL_NOTEQUAL</code>
711 </td><td align="left">
712 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
713
714 <mml:mrow>
715 <mml:mi mathvariant="italic">result</mml:mi>
716 <mml:mo>=</mml:mo>
717 <mml:mfenced open="{" close="">
718 <mml:mrow>
719 <mml:mtable>
720 <mml:mtr><mml:mtd>
721 <mml:mn>1.0</mml:mn>
722 </mml:mtd></mml:mtr>
723 <mml:mtr><mml:mtd>
724 <mml:mn>0.0</mml:mn>
725 </mml:mtd></mml:mtr>
726 </mml:mtable>
727 <mml:mo>⁢  </mml:mo>
728 <mml:mtable>
729 <mml:mtr><mml:mtd>
730 <mml:mrow>
731 <mml:mi mathvariant="italic">r</mml:mi>
732 <mml:mo></mml:mo>
733 <mml:mfenced open="" close="">
734 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
735 <mml:mi mathvariant="italic">t</mml:mi>
736 </mml:msub>
737 </mml:mfenced>
738 </mml:mrow>
739 </mml:mtd></mml:mtr>
740 <mml:mtr><mml:mtd>
741 <mml:mrow>
742 <mml:mi mathvariant="italic">r</mml:mi>
743 <mml:mo>=</mml:mo>
744 <mml:mfenced open="" close="">
745 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
746 <mml:mi mathvariant="italic">t</mml:mi>
747 </mml:msub>
748 </mml:mfenced>
749 </mml:mrow>
750 </mml:mtd></mml:mtr>
751 </mml:mtable>
752 </mml:mrow>
753 </mml:mfenced>
754 </mml:mrow>
755 </mml:math></div>
756 </td></tr><tr><td align="left">
757 <code class="constant">GL_ALWAYS</code>
758 </td><td align="left">
759 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
760 <mml:mrow>
761 <mml:mi mathvariant="italic">result</mml:mi>
762 <mml:mo>=</mml:mo>
763 <mml:mi>1.0</mml:mi>
764 </mml:mrow>
765 </mml:math></div>
766 </td></tr><tr><td align="left">
767 <code class="constant">GL_NEVER</code>
768 </td><td align="left">
769 <div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
770 <mml:mrow>
771 <mml:mi mathvariant="italic">result</mml:mi>
772 <mml:mo>=</mml:mo>
773 <mml:mi>0.0</mml:mi>
774 </mml:mrow>
775 </mml:math></div>
776 </td></tr></tbody></table></div><p>
777 where <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math>
778 is the current interpolated texture coordinate, and
779 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
780
781 <mml:msub><mml:mi mathvariant="italic">D</mml:mi>
782 <mml:mi mathvariant="italic">t</mml:mi>
783 </mml:msub>
784 </mml:math>
785 is the texture value sampled from the currently bound texture.
786 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">result</mml:mi></mml:math>
787 is assigned to
788 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
789
790 <mml:msub><mml:mi mathvariant="italic">R</mml:mi>
791 <mml:mi mathvariant="italic">t</mml:mi>
792 </mml:msub>
793 </mml:math>.
794 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
795 <code class="function">glSamplerParameter</code> is available only if the GL version is 3.3 or higher.
796 </p><p>
797 If a sampler object is bound to a texture unit and that unit is used to sample from a texture, the parameters in the sampler
798 are used to sample from the texture, rather than the equivalent parameters in the texture object bound to that unit. This
799 introduces the possibility of sampling from the same texture object with different sets of sampler state, which may lead to
800 a condition where a texture is <span class="emphasis"><em>incomplete</em></span> with respect to one sampler object and not with respect to
801 another. Thus, completeness can be considered a function of a sampler object and a texture object bound to a single
802 texture unit, rather than a property of the texture object itself.
803 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
804 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>sampler</code></em> is not the name of a sampler object previously
805 returned from a call to <a href="glGenSamplers.xml"><span class="citerefentry"><span class="refentrytitle">glGenSamplers</span></span></a>.
806 </p><p>
807 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>params</code></em> should have a defined
808 constant value (based on the value of <em class="parameter"><code>pname</code></em>) and does not.
809 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
810 <a href="glGetSamplerParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetSamplerParameter</span></span></a>
811 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
812 <a href="glGenSamplers.xml"><span class="citerefentry"><span class="refentrytitle">glGenSamplers</span></span></a>,
813 <a href="glBindSampler.xml"><span class="citerefentry"><span class="refentrytitle">glBindSampler</span></span></a>,
814 <a href="glDeleteSamplers.xml"><span class="citerefentry"><span class="refentrytitle">glDeleteSamplers</span></span></a>,
815 <a href="glIsSampler.xml"><span class="citerefentry"><span class="refentrytitle">glIsSampler</span></span></a>,
816 <a href="glBindTexture.xml"><span class="citerefentry"><span class="refentrytitle">glBindTexture</span></span></a>,
817 <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
818 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
819 Copyright <span class="trademark"></span>© 2010 Khronos Group.
820 This material may be distributed subject to the terms and conditions set forth in
821 the Open Publication License, v 1.0, 8 June 1999.
822 <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
823 </p></div></div></body></html>