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