Manpage of GLTEXPARAMETER
GLTEXPARAMETER
Index
NAME
glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv
- set texture parameters
C SPECIFICATION
void f3glTexParameterffP(
GLenum fItargetfP,
GLenum fIpnamefP,
GLint fIparamfP )
delim $$
PARAMETERS
- f2targetfP
-
Specifies the target texture,
which must be either %f3GL_TEXTURE_1DfP, %f3GL_TEXTURE_2DfP, or
%f3GL_TEXTURE_3DfP.
- f2pnamefP
-
Specifies the symbolic name of a single-valued texture parameter.
f2pnamefP can be one of the following:
%f3GL_TEXTURE_MIN_FILTERfP,
%f3GL_TEXTURE_MAG_FILTERfP,
%f3GL_TEXTURE_MIN_LODfP,
%f3GL_TEXTURE_MAX_LODfP,
%f3GL_TEXTURE_BASE_LEVELfP,
%f3GL_TEXTURE_MAX_LEVELfP,
%f3GL_TEXTURE_WRAP_SfP,
%f3GL_TEXTURE_WRAP_TfP,
%f3GL_TEXTURE_WRAP_RfP, or
%f3GL_TEXTURE_PRIORITYfP.
- f2paramfP
-
Specifies the value of f2pnamefP.
C SPECIFICATION
void f3glTexParameterfvfP(
GLenum fItargetfP,
GLenum fIpnamefP,
const GLint fI*paramsfP )
PARAMETERS
- f2targetfP
-
Specifies the target texture,
which must be either %f3GL_TEXTURE_1DfP, %f3GL_TEXTURE_2DfP or
%f3GL_TEXTURE_3DfP.
- f2pnamefP
-
Specifies the symbolic name of a texture parameter.
f2pnamefP can be one of the following:
%f3GL_TEXTURE_MIN_FILTERfP,
%f3GL_TEXTURE_MAG_FILTERfP,
%f3GL_TEXTURE_MIN_LODfP,
%f3GL_TEXTURE_MAX_LODfP,
%f3GL_TEXTURE_BASE_LEVELfP,
%f3GL_TEXTURE_MAX_LEVELfP,
%f3GL_TEXTURE_WRAP_SfP,
%f3GL_TEXTURE_WRAP_TfP,
%f3GL_TEXTURE_WRAP_RfP,
%f3GL_TEXTURE_BORDER_COLORfP, or
%f3GL_TEXTURE_PRIORITYfP.
- f2paramsfP
-
Specifies a pointer to an array where the value or values of f2pnamefP
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.
%f3glTexParameterfP assigns the value or values in f2paramsfP to the texture parameter
specified as f2pnamefP.
f2targetfP defines the target texture,
either %f3GL_TEXTURE_1DfP, %f3GL_TEXTURE_2DfP, or %f3GL_TEXTURE_3DfP.
The following symbols are accepted in f2pnamefP:
- %f3GL_TEXTURE_MIN_FILTERfP
-
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 %f3glTexImage1DfP, %f3glTexImage2DfP,
%f3glTexImage3DfP,
%f3glCopyTexImage1DfP, or %f3glCopyTexImage2DfP
with the f2levelfP 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.
-
f2paramsfP supplies a function for minifying the texture as one of the following:
-
- %f3GL_NEARESTfP
-
Returns the value of the texture element that is nearest
(in Manhattan distance)
to the center of the pixel being textured.
- %f3GL_LINEARfP
-
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 %f3GL_TEXTURE_WRAP_SfP and %f3GL_TEXTURE_WRAP_TfP,
and on the exact mapping.
- %f3GL_NEAREST_MIPMAP_NEARESTfP
-
Chooses the mipmap that most closely matches the size of the pixel
being textured and uses the %f3GL_NEARESTfP criterion
(the texture element nearest to the center of the pixel)
to produce a texture value.
- %f3GL_LINEAR_MIPMAP_NEARESTfP
-
Chooses the mipmap that most closely matches the size of the pixel
being textured and uses the %f3GL_LINEARfP criterion
(a weighted average of the four texture elements that are closest
to the center of the pixel)
to produce a texture value.
- %f3GL_NEAREST_MIPMAP_LINEARfP
-
Chooses the two mipmaps that most closely match the size of the pixel
being textured and uses the %f3GL_NEARESTfP 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.
- %f3GL_LINEAR_MIPMAP_LINEARfP
-
Chooses the two mipmaps that most closely match the size of the pixel
being textured and uses the %f3GL_LINEARfP 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 %f3GL_NEARESTfP and %f3GL_LINEARfP 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 %f3GL_TEXTURE_MIN_FILTERfP is
%f3GL_NEAREST_MIPMAP_LINEARfP.
- %f3GL_TEXTURE_MAG_FILTERfP
-
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 %f3GL_NEARESTfP
or %f3GL_LINEARfP (see below). %f3GL_NEARESTfP is generally faster
than %f3GL_LINEARfP,
but it can produce textured images with sharper edges
because the transition between texture elements is not as smooth.
The initial value of %f3GL_TEXTURE_MAG_FILTERfP is %f3GL_LINEARfP.
-
- %f3GL_NEARESTfP
-
Returns the value of the texture element that is nearest
(in Manhattan distance)
to the center of the pixel being textured.
- %f3GL_LINEARfP
-
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 %f3GL_TEXTURE_WRAP_SfP and %f3GL_TEXTURE_WRAP_TfP,
and on the exact mapping.
- %f3GL_TEXTURE_MIN_LODfP
-
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.
- %f3GL_TEXTURE_MAX_LODfP
-
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.
- %f3GL_TEXTURE_BASE_LEVELfP
-
Specifies the index of the lowest defined mipmap level. This is an
integer value. The initial value is 0.
- %f3GL_TEXTURE_MAX_LEVELfP
-
Sets the index of the highest defined mipmap level. This is an integer
value. The initial value is 1000.
- %f3GL_TEXTURE_WRAP_SfP
-
Sets the wrap parameter for texture coordinate $s$ to either
%f3GL_CLAMPfP, %f3GL_CLAMP_TO_EDGEfP, or %f3GL_REPEATfP.
%f3GL_CLAMPfP 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.
%f3GL_CLAMP_TO_EDGEfP 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.
%f3GL_REPEATfP 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 %f3GL_CLAMPfP.
Initially, %f3GL_TEXTURE_WRAP_SfP is set to %f3GL_REPEATfP.
- %f3GL_TEXTURE_WRAP_TfP
-
Sets the wrap parameter for texture coordinate $t$ to either
%f3GL_CLAMPfP, %f3GL_CLAMP_TO_EDGEfP, or %f3GL_REPEATfP.
See the discussion under %f3GL_TEXTURE_WRAP_SfP.
Initially, %f3GL_TEXTURE_WRAP_TfP is set to %f3GL_REPEATfP.
- %f3GL_TEXTURE_WRAP_RfP
-
Sets the wrap parameter for texture coordinate $r$ to either
%f3GL_CLAMPfP, %f3GL_CLAMP_TO_EDGEfP, or %f3GL_REPEATfP.
See the discussion under %f3GL_TEXTURE_WRAP_SfP.
Initially, %f3GL_TEXTURE_WRAP_RfP is set to %f3GL_REPEATfP.
- %f3GL_TEXTURE_BORDER_COLORfP
-
Sets a border color.
f2paramsfP 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).
- %f3GL_TEXTURE_PRIORITYfP
-
Specifies the texture residence priority of the currently bound texture.
Permissible values are in the range [0, 1].
See %f3glPrioritizeTexturesfP and %f3glBindTexturefP for more information.
NOTES
%f3GL_TEXTURE_3DfP, %f3GL_TEXTURE_MIN_LODfP, %f3GL_TEXTURE_MAX_LODfP,
%f3GL_TEXTURE_BASE_LEVELfP, and %f3GL_TEXTURE_MAX_LEVELfP are only
available if the GL version is 1.2 or greater.
Suppose that a program has enabled texturing
(by calling %f3glEnablefP
with argument %f3GL_TEXTURE_1DfP, %f3GL_TEXTURE_2DfP, or %f3GL_TEXTURE_3DfP)
and has set %f3GL_TEXTURE_MIN_FILTERfP to one of the functions
that requires a mipmap.
If either the dimensions of the texture images currently defined
(with previous calls to %f3glTexImage1DfP, %f3glTexImage2DfP,
%f3glTexImage3DfP,
%f3glCopyTexImage1DfP, or %f3glCopyTexImage2DfP)
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 %f3GL_ARB_multitexturefP extension is supported, %f3glTexParameterfP
specifies the texture parameters for the active texture unit, specified
by calling %f3glActiveTextureARBfP.
ERRORS
%f3GL_INVALID_ENUMfP is generated if f2targetfP or f2pnamefP is not
one of the accepted defined values.
%f3GL_INVALID_ENUMfP is generated if f2paramsfP should have a defined
constant value (based on the value of f2pnamefP) and does not.
%f3GL_INVALID_OPERATIONfP is generated if %f3glTexParameterfP
is executed between the execution of %f3glBeginfP
and the corresponding execution of %f3glEndfP.
ASSOCIATED GETS
%f3glGetTexParameterfP
%f3glGetTexLevelParameterfP
SEE ALSO
%f3glActiveTextureARB(3G)fP,
%f3glBindTexture(3G)fP,
%f3glCopyPixels(3G)fP,
%f3glCopyTexImage1D(3G)fP,
%f3glCopyTexImage2D(3G)fP,
%f3glCopyTexSubImage1D(3G)fP,
%f3glCopyTexSubImage2D(3G)fP,
%f3glCopyTexSubImage3D(3G)fP,
%f3glDrawPixels(3G)fP,
%f3glPixelStore(3G)fP,
%f3glPixelTransfer(3G)fP,
%f3glPrioritizeTextures(3G)fP,
%f3glTexEnv(3G)fP,
%f3glTexGen(3G)fP,
%f3glTexImage1D(3G)fP,
%f3glTexImage2D(3G)fP,
%f3glTexImage3D(3G)fP,
%f3glTexSubImage1D(3G)fP,
%f3glTexSubImage2D(3G)fP,
%f3glTexSubImage3D(3G)fP
Index
- NAME
-
- C SPECIFICATION
-
- PARAMETERS
-
- C SPECIFICATION
-
- PARAMETERS
-
- DESCRIPTION
-
- NOTES
-
- ERRORS
-
- ASSOCIATED GETS
-
- SEE ALSO
-
|