NAME

glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv - set texture parameters

C SPECIFICATION

void ggllTTeexxPPaarraammeetteerrff( GLenum _t_a_r_g_e_t,
                      GLenum _p_n_a_m_e,
                      GLfloat _p_a_r_a_m )
void ggllTTeexxPPaarraammeetteerrii( GLenum _t_a_r_g_e_t,
                      GLenum _p_n_a_m_e,
                      GLint _p_a_r_a_m )

delim $$

PARAMETERS

_t_a_r_g_e_t
Specifies the target texture, which must be either GGLL__TTEEXXTTUURREE__11DD, GGLL__TTEEXXTTUURREE__22DD, or GGLL__TTEEXXTTUURREE__33DD.
_p_n_a_m_e
Specifies the symbolic name of a single-valued texture parameter. _p_n_a_m_e can be one of the following: GGLL__TTEEXXTTUURREE__MMIINN__FFIILLTTEERR, GGLL__TTEEXXTTUURREE__MMAAGG__FFIILLTTEERR, GGLL__TTEEXXTTUURREE__MMIINN__LLOODD, GGLL__TTEEXXTTUURREE__MMAAXX__LLOODD, GGLL__TTEEXXTTUURREE__BBAASSEE__LLEEVVEELL, GGLL__TTEEXXTTUURREE__MMAAXX__LLEEVVEELL, GGLL__TTEEXXTTUURREE__WWRRAAPP__SS, GGLL__TTEEXXTTUURREE__WWRRAAPP__TT, GGLL__TTEEXXTTUURREE__WWRRAAPP__RR, or GGLL__TTEEXXTTUURREE__PPRRIIOORRIITTYY.
_p_a_r_a_m
Specifies the value of _p_n_a_m_e.

C SPECIFICATION

void ggllTTeexxPPaarraammeetteerrffvv( GLenum _t_a_r_g_e_t,
                       GLenum _p_n_a_m_e,
                       const GLfloat _*_p_a_r_a_m_s )
void ggllTTeexxPPaarraammeetteerriivv( GLenum _t_a_r_g_e_t,
                       GLenum _p_n_a_m_e,
                       const GLint _*_p_a_r_a_m_s )

PARAMETERS

_t_a_r_g_e_t
Specifies the target texture, which must be either GGLL__TTEEXXTTUURREE__11DD, GGLL__TTEEXXTTUURREE__22DD or GGLL__TTEEXXTTUURREE__33DD.
_p_n_a_m_e
Specifies the symbolic name of a texture parameter. _p_n_a_m_e can be one of the following: GGLL__TTEEXXTTUURREE__MMIINN__FFIILLTTEERR, GGLL__TTEEXXTTUURREE__MMAAGG__FFIILLTTEERR, GGLL__TTEEXXTTUURREE__MMIINN__LLOODD, GGLL__TTEEXXTTUURREE__MMAAXX__LLOODD, GGLL__TTEEXXTTUURREE__BBAASSEE__LLEEVVEELL, GGLL__TTEEXXTTUURREE__MMAAXX__LLEEVVEELL, GGLL__TTEEXXTTUURREE__WWRRAAPP__SS, GGLL__TTEEXXTTUURREE__WWRRAAPP__TT, GGLL__TTEEXXTTUURREE__WWRRAAPP__RR, GGLL__TTEEXXTTUURREE__BBOORRDDEERR__CCOOLLOORR, or GGLL__TTEEXXTTUURREE__PPRRIIOORRIITTYY.
_p_a_r_a_m_s
Specifies a pointer to an array where the value or values of _p_n_a_m_e are stored.

DESCRIPTION

Texture mapping is a technique that applies an image onto an object's surface as if the image were a decal or cellophane shrink-wrap. The image is created in texture space, with an ($s$, $t$) coordinate system. A texture is a one- or two-dimensional image and a set of parameters that determine how samples are derived from the image.

ggllTTeexxPPaarraammeetteerr assigns the value or values in _p_a_r_a_m_s to the texture parameter specified as _p_n_a_m_e. _t_a_r_g_e_t defines the target texture, either GGLL__TTEEXXTTUURREE__11DD, GGLL__TTEEXXTTUURREE__22DD, or GGLL__TTEEXXTTUURREE__33DD. The following symbols are accepted in _p_n_a_m_e:

GGLL__TTEEXXTTUURREE__MMIINN__FFIILLTTEERR
The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element. There are six defined minifying functions. Two of them use the nearest one or nearest four texture elements to compute the texture value. The other four use mipmaps.
A mipmap is an ordered set of arrays representing the same image
at progressively lower resolutions. If the texture has dimensions $2 sup n ~times~ 2 sup m$, there are $ bold max ( n, m ) + 1 $ mipmaps. The first mipmap is the original texture, with dimensions $2 sup n ~times~ 2 sup m$. Each subsequent mipmap has dimensions $2 sup { k - 1 } ~times~ 2 sup { l - 1 }$, where $2 sup k ~times~ 2 sup l$ are the dimensions of the previous mipmap, until either $k ~=~ 0$ or $l~=~0$. At that point, subsequent mipmaps have dimension $ 1 ~times~ 2 sup { l - 1 } $ or $ 2 sup { k - 1} ~times~ 1 $ until the final mipmap, which has dimension $1 ~times~ 1$. To define the mipmaps, call ggllTTeexxIImmaaggee11DD, ggllTTeexxIImmaaggee22DD, ggllTTeexxIImmaaggee33DD, ggllCCooppyyTTeexxIImmaaggee11DD, or ggllCCooppyyTTeexxIImmaaggee22DD with the _l_e_v_e_l argument indicating the order of the mipmaps. Level 0 is the original texture; level $ bold max ( n, m ) $ is the final $1 ~times~ 1$ mipmap.
_p_a_r_a_m_s supplies a function for minifying the texture as one of the following:
GGLL__NNEEAARREESSTT
Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
GGLL__LLIINNEEAARR
Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of GGLL__TTEEXXTTUURREE__WWRRAAPP__SS and GGLL__TTEEXXTTUURREE__WWRRAAPP__TT, and on the exact mapping.
GGLL__NNEEAARREESSTT__MMIIPPMMAAPP__NNEEAARREESSTT
Chooses the mipmap that most closely matches the size of the pixel being textured and uses the GGLL__NNEEAARREESSTT criterion (the texture element nearest to the center of the pixel) to produce a texture value.
GGLL__LLIINNEEAARR__MMIIPPMMAAPP__NNEEAARREESSTT
Chooses the mipmap that most closely matches the size of the pixel being textured and uses the GGLL__LLIINNEEAARR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value.
GGLL__NNEEAARREESSTT__MMIIPPMMAAPP__LLIINNEEAARR
Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GGLL__NNEEAARREESSTT criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
GGLL__LLIINNEEAARR__MMIIPPMMAAPP__LLIINNEEAARR
Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GGLL__LLIINNEEAARR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
As more texture elements are sampled in the minification process,
fewer aliasing artifacts will be apparent. While the GGLL__NNEEAARREESSTT and GGLL__LLIINNEEAARR minification functions can be faster than the other four, they sample only one or four texture elements to determine the texture value of the pixel being rendered and can produce moire patterns or ragged transitions. The initial value of GGLL__TTEEXXTTUURREE__MMIINN__FFIILLTTEERR is GGLL__NNEEAARREESSTT__MMIIPPMMAAPP__LLIINNEEAARR.
GGLL__TTEEXXTTUURREE__MMAAGG__FFIILLTTEERR
The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element. It sets the texture magnification function to either GGLL__NNEEAARREESSTT or GGLL__LLIINNEEAARR (see below). GGLL__NNEEAARREESSTT is generally faster than GGLL__LLIINNEEAARR, but it can produce textured images with sharper edges because the transition between texture elements is not as smooth. The initial value of GGLL__TTEEXXTTUURREE__MMAAGG__FFIILLTTEERR is GGLL__LLIINNEEAARR.
GGLL__NNEEAARREESSTT
Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
GGLL__LLIINNEEAARR
Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of GGLL__TTEEXXTTUURREE__WWRRAAPP__SS and GGLL__TTEEXXTTUURREE__WWRRAAPP__TT, and on the exact mapping.

GGLL__TTEEXXTTUURREE__MMIINN__LLOODD
Sets the minimum level-of-detail parameter. This floating-point value limits the selection of highest resolution mipmap (lowest mipmap level). The initial value is -1000.

GGLL__TTEEXXTTUURREE__MMAAXX__LLOODD
Sets the maximum level-of-detail parameter. This floating-point value limits the selection of the lowest resolution mipmap (highest mipmap level). The initial value is 1000.

GGLL__TTEEXXTTUURREE__BBAASSEE__LLEEVVEELL
Specifies the index of the lowest defined mipmap level. This is an integer value. The initial value is 0.

GGLL__TTEEXXTTUURREE__MMAAXX__LLEEVVEELL
Sets the index of the highest defined mipmap level. This is an integer value. The initial value is 1000.

GGLL__TTEEXXTTUURREE__WWRRAAPP__SS
Sets the wrap parameter for texture coordinate $s$ to either GGLL__CCLLAAMMPP, GGLL__CCLLAAMMPP__TTOO__EEDDGGEE, or GGLL__RREEPPEEAATT. GGLL__CCLLAAMMPP causes $s$ coordinates to be clamped to the range [0,1] and is useful for preventing wrapping artifacts when mapping a single image onto an object. GGLL__CCLLAAMMPP__TTOO__EEDDGGEE causes $s$ coordinates to be clamped to the range $left [ {1 over 2N}, 1 - {1 over 2N} right ]$, where $N$ is the size of the texture in the direction of clamping. GGLL__RREEPPEEAATT causes the integer part of the $s$ coordinate to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern. Border texture elements are accessed only if wrapping is set to GGLL__CCLLAAMMPP. Initially, GGLL__TTEEXXTTUURREE__WWRRAAPP__SS is set to GGLL__RREEPPEEAATT.

GGLL__TTEEXXTTUURREE__WWRRAAPP__TT
Sets the wrap parameter for texture coordinate $t$ to either GGLL__CCLLAAMMPP, GGLL__CCLLAAMMPP__TTOO__EEDDGGEE, or GGLL__RREEPPEEAATT. See the discussion under GGLL__TTEEXXTTUURREE__WWRRAAPP__SS. Initially, GGLL__TTEEXXTTUURREE__WWRRAAPP__TT is set to GGLL__RREEPPEEAATT.
GGLL__TTEEXXTTUURREE__WWRRAAPP__RR
Sets the wrap parameter for texture coordinate $r$ to either GGLL__CCLLAAMMPP, GGLL__CCLLAAMMPP__TTOO__EEDDGGEE, or GGLL__RREEPPEEAATT. See the discussion under GGLL__TTEEXXTTUURREE__WWRRAAPP__SS. Initially, GGLL__TTEEXXTTUURREE__WWRRAAPP__RR is set to GGLL__RREEPPEEAATT.
GGLL__TTEEXXTTUURREE__BBOORRDDEERR__CCOOLLOORR
Sets a border color. _p_a_r_a_m_s contains four values that comprise the RGBA color of the texture border. Integer color components are interpreted linearly such that the most positive integer maps to 1.0, and the most negative integer maps to -1.0. The values are clamped to the range [0,1] when they are specified. Initially, the border color is (0, 0, 0, 0).
GGLL__TTEEXXTTUURREE__PPRRIIOORRIITTYY
Specifies the texture residence priority of the currently bound texture. Permissible values are in the range [0, 1]. See ggllPPrriioorriittiizzeeTTeexxttuurreess and ggllBBiinnddTTeexxttuurree for more information.

NOTES

GGLL__TTEEXXTTUURREE__33DD, GGLL__TTEEXXTTUURREE__MMIINN__LLOODD, GGLL__TTEEXXTTUURREE__MMAAXX__LLOODD, GGLL__TTEEXXTTUURREE__BBAASSEE__LLEEVVEELL, and GGLL__TTEEXXTTUURREE__MMAAXX__LLEEVVEELL are only available if the GL version is 1.2 or greater.

Suppose that a program has enabled texturing (by calling ggllEEnnaabbllee with argument GGLL__TTEEXXTTUURREE__11DD, GGLL__TTEEXXTTUURREE__22DD, or GGLL__TTEEXXTTUURREE__33DD) and has set GGLL__TTEEXXTTUURREE__MMIINN__FFIILLTTEERR to one of the functions that requires a mipmap. If either the dimensions of the texture images currently defined (with previous calls to ggllTTeexxIImmaaggee11DD, ggllTTeexxIImmaaggee22DD, ggllTTeexxIImmaaggee33DD, ggllCCooppyyTTeexxIImmaaggee11DD, or ggllCCooppyyTTeexxIImmaaggee22DD) do not follow the proper sequence for mipmaps (described above), or there are fewer texture images defined than are needed, or the set of texture images have differing numbers of texture components, then it is as if texture mapping were disabled.

Linear filtering accesses the four nearest texture elements only in 2D textures. In 1D textures, linear filtering accesses the two nearest texture elements.

When the GGLL__AARRBB__mmuullttiitteexxttuurree extension is supported, ggllTTeexxPPaarraammeetteerr specifies the texture parameters for the active texture unit, specified by calling ggllAAccttiivveeTTeexxttuurreeAARRBB.

ERRORS

GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _t_a_r_g_e_t or _p_n_a_m_e is not one of the accepted defined values.

GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _p_a_r_a_m_s should have a defined constant value (based on the value of _p_n_a_m_e) and does not.

GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllTTeexxPPaarraammeetteerr is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.

ASSOCIATED GETS

ggllGGeettTTeexxPPaarraammeetteerr
ggllGGeettTTeexxLLeevveellPPaarraammeetteerr

SEE ALSO

ggllAAccttiivveeTTeexxttuurreeAARRBB((33GG)), ggllBBiinnddTTeexxttuurree((33GG)), ggllCCooppyyPPiixxeellss((33GG)), ggllCCooppyyTTeexxIImmaaggee11DD((33GG)), ggllCCooppyyTTeexxIImmaaggee22DD((33GG)), ggllCCooppyyTTeexxSSuubbIImmaaggee11DD((33GG)), ggllCCooppyyTTeexxSSuubbIImmaaggee22DD((33GG)), ggllCCooppyyTTeexxSSuubbIImmaaggee33DD((33GG)), ggllDDrraawwPPiixxeellss((33GG)), ggllPPiixxeellSSttoorree((33GG)), ggllPPiixxeellTTrraannssffeerr((33GG)), ggllPPrriioorriittiizzeeTTeexxttuurreess((33GG)), ggllTTeexxEEnnvv((33GG)), ggllTTeexxGGeenn((33GG)), ggllTTeexxIImmaaggee11DD((33GG)), ggllTTeexxIImmaaggee22DD((33GG)), ggllTTeexxIImmaaggee33DD((33GG)), ggllTTeexxSSuubbIImmaaggee11DD((33GG)), ggllTTeexxSSuubbIImmaaggee22DD((33GG)), ggllTTeexxSSuubbIImmaaggee33DD((33GG))