glTexParameter(3G) OpenGL Reference glTexParameter(3G)
NAME
glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv -
set texture parameters
C SPECIFICATION
void glTexParameterf( GLenum target,
GLenum pname,
GLfloat param )
void glTexParameteri( GLenum target,
GLenum pname,
GLint param )
PARAMETERS
target Specifies the target texture, which must be either GLTEXTURE1D,
GLTEXTURE2D, GLDETAILTEXTURE2DSGIS, or GLTEXTURE3DEXT.
GLTEXTURE4DSGIS.
pname Specifies the symbolic name of a single-valued texture parameter.
pname can be one of the following: GLTEXTUREMINFILTER,
GLTEXTUREMAGFILTER, GLTEXTUREWRAPS, GLTEXTUREWRAPT,
GLTEXTUREWRAPREXT, GLTEXTUREWRAPQSGIS,
GLDETAILTEXTURELEVELSGIS, GLDETAILTEXTUREMODESGIS,
GLTEXTUREPRIORITYEXT, GLTEXTUREBASELEVELSGIS,
GLTEXTUREMAXLEVELSGIS, GLTEXTUREMINLODSGIS,
GLTEXTUREMAXLODSGIS, GLTEXTURELODBIASSSGIX,
GLTEXTURELODBIASTSGIX, GLTEXTURELODBIASRSGIX,
GLDUALTEXTURESELECTSGIS, GLQUADTEXTURESELECTSGIS,
GLTEXTURECLIPMAPFRAMESGIX, GLTEXTURECOMPARESGIX,
GLTEXTURECOMPAREOPERATORSGIX, or GLSHADOWAMBIENTSGIX.
param Specifies the value of pname.
C SPECIFICATION
void glTexParameterfv( GLenum target,
GLenum pname,
const GLfloat *params )
void glTexParameteriv( GLenum target,
GLenum pname,
const GLint *params )
PARAMETERS
target
Specifies the target texture, which must be either GLTEXTURE1D,
GLTEXTURE2D, GLDETAILTEXTURE2DSGIS, or GLTEXTURE3DEXT.
GLTEXTURE4DSGIS.
pname
Specifies the symbolic name of a texture parameter. pname can be
one of the following: GLTEXTUREMINFILTER, GLTEXTUREMAGFILTER,
Page 1
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
GLTEXTUREWRAPS, GLTEXTUREWRAPT, GLTEXTUREWRAPREXT,
GLTEXTUREWRAPQSGIS, GLDETAILTEXTURELEVELSGIS,
GLDETAILTEXTUREMODESGIS, GLPOSTTEXTUREFILTERBIASSGIX,
GLPOSTTEXTUREFILTERSCALESGIX, GLTEXTUREBORDERCOLOR,
GLTEXTUREPRIORITYEXT, GLTEXTUREBASELEVELSGIS,
GLTEXTUREMAXLEVELSGIS, GLTEXTUREMINLODSGIS,
GLTEXTUREMAXLODSGIS, GLTEXTURELODBIASSSGIX,
GLTEXTURELODBIASTSGIX, GLTEXTURELODBIASRSGIX,
GLDUALTEXTURESELECTSGIS, GLQUADTEXTURESELECTSGIS,
GLTEXTURECLIPMAPFRAMESGIX, GLTEXTURECLIPMAPCENTERSGIX,
GLTEXTURECLIPMAPOFFSETSGIX,
GLTEXTURECLIPMAPVIRTUALDEPTHSGIX, GLTEXTURECOMPARESGIX,
GLTEXTURECOMPAREOPERATORSGIX, or GLSHADOWAMBIENTSGIX.
params
Specifies a pointer to an array where the value or values of pname
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, r) coordinate system. A
texture is a one-, two-, or three-dimensional image and a set of
parameters that determine how samples are derived from the image.
glTexParameter assigns the value in param (or values in params) to the
texture parameter specified by pname. target defines the target texture:
GLTEXTURE1D, GLTEXTURE2D, GLDETAILTEXTURE2DSGIS, or
GLTEXTURE3DEXT. The following symbols are accepted in pname:
GLTEXTUREMINFILTER
The texture minifying function is used whenever the pixel being
textured maps to an area greater than one texture element.
There are eight defined minifying functions. Two of them use
the nearest one or nearest four texture elements to compute the
texture value. Four use mipmaps, and one uses a mipmap variant
called a clipmap. One uses an application-specified filter
that combines four adjacent texture elements (in the 1D case)
or sixteen adjacent texture elements (in the 2D case).
A mipmap is an ordered set of arrays representing the same
image at progressively lower resolutions. If the texture has
dimensions 2**n x 2**m there are max(n,m)+1 mipmaps. The first
mipmap is the original texture, with dimensions 2**n x 2**m.
Each subsequent mipmap has dimensions 2**(k-1) x 2**(l-1) where
2**k x 2**l are the dimensions of the previous mipmap, until
either k=0 or l=0. At that point, subsequent mipmaps have
dimension 1 x 2**(l-1) or 2**(k-1) x 1 until the final mipmap,
which has dimension 1 x 1. Mipmaps are defined using
glTexImage1D, glTexImage2D or glTexImage3DEXT with the level-
of-detail argument indicating the order of the mipmaps. Level
Page 2
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
0 is the original texture; level max(n,m) is the final 1 x 1
mipmap.
A clipmap virtualizes a 2D mipmap by storing and using only a
portion of a full mipmap ``pyramid'' at any given time. In a
clipmap with N+1 levels numbered 0 (the base) through N (the
tip), each image level from B through N contains the full image
from the corresponding level of the complete mipmap. Each
image level from 0 through B-1 contains a subimage of the
corresponding level of the complete mipmap, called the region
of interest. The region of interest must be the same size in
all the levels 0 through B-1 - that is, precisely the same size
as the texture image at mipmap level B. For the clipmap to be
usable, only the region of interest need reside in texture
memory. When texture filtering requires texels (texture
elements) that are inside the region of interest for a level,
they are fetched in just the way they would be accessed for a
mipmap. When the required texels fall outside the region of
interest, then successively higher clipmap levels are queried
until one is found that contains texels at the appropriate
coordinates.
Since each 2D mipmap level usually contains four times as many
texels as the subsequent level, using a clipmap for a few of
the highest-resolution levels can reduce texture memory
requirements tremendously. In addition to reducing memory
requirements, clipmaps also have features that support paging
texture images into and out of texture memory. Clipmaps also
can be virtualized to support many more levels of detail than
ordinarily would be available. (See below for more information
on paging and virtualization.) Note that clipmaps may be used
only with borderless 2D textures.
param supplies a function for minifying the texture as one of
the following:
GLNEAREST
Returns the value of the texture element that is
nearest (in Manhattan distance) to the center of the
pixel being textured.
GLLINEAR Returns the weighted average of the two, four, or
eight texture elements that are closest to the center
of the pixel being textured. These can include
border texture elements, depending on the values of
GLTEXTUREWRAPS, GLTEXTUREWRAPT, and
GLTEXTUREWRAPREXT, and on the exact mapping.
GLNEARESTMIPMAPNEAREST
Chooses the mipmap that most closely matches the size
of the pixel being textured and uses the GLNEAREST
criterion (the texture element nearest to the center
Page 3
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
of the pixel) to produce a texture value.
GLLINEARMIPMAPNEAREST
Chooses the mipmap that most closely matches the size
of the pixel being textured and uses the GLLINEAR
criterion (a weighted average of the four texture
elements that are closest to the center of the pixel)
to produce a texture value.
GLNEARESTMIPMAPLINEAR
Chooses the two mipmaps that most closely match the
size of the pixel being textured and uses the
GLNEAREST 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.
GLLINEARMIPMAPLINEAR
Chooses the two mipmaps that most closely match the
size of the pixel being textured and uses the
GLLINEAR 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.
GLPIXELTEXGENQCEILINGSGIX
GLPIXELTEXGENQFLOORSGIX
GLPIXELTEXGENQROUNDSGIX
The SGIXimpactpixeltexture extension allows the
glPixelTexGenSGIX command to utilize a 4D texture
when there is no hardware support for linear
interpolation in the q coordinate. In this case the
application may get the desired result from a two-
pass operation; on the first pass the filter function
is set to ceiling with alpha-blending disabled,
followed by a second pass set to floor with the
appropriate blendfunction set. If a nearest-neighbor
mode is acceptable, a one-pass method can be used
with the filter set to round (the default).
Additional information about 4D pixel-texturing can
be found man pages for glPixelTexGenSGIX.
GLFILTER4SGIS
Returns a weighted average of the four texture
elements (in the 1D case) or the sixteen texture
elements (in the 2D case) that are closest to the
center of the pixel being textured. These can
Page 4
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
include border texture elements, although the
behavior in such cases is rarely useful. The weights
are derived from a filter kernel specified by the
user; see glTexFilterFuncSGIS for details. Note that
this mode is not supported for 3D textures.
GLLINEARCLIPMAPLINEARSGIX
Similar to GLLINEARMIPMAPLINEAR, but used only
with clipmaps. This method may be used with any
magnification filter except GLFILTER4SGIS; however,
detail and sharpen filtering are performed only when
texels are supplied by the level 0 image of the
clipmap.
As more texture elements are sampled in the minification
process, fewer aliasing artifacts will be apparent. While the
GLNEAREST and GLLINEAR minification functions can be faster
than the four mipmap filtering modes, they sample only one,
four, or eight texture elements to determine the texture value
of the pixel being rendered and can produce moire patterns or
ragged transitions. The default value of GLTEXTUREMINFILTER
is GLNEARESTMIPMAPLINEAR.
GLTEXTUREMAGFILTER
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 any of
the following:
GLNEAREST
Returns the value of the texture element that is
nearest (in Manhattan distance) to the center of the
pixel being textured.
GLLINEAR Returns the weighted average of the two, four, or
eight texture elements that are closest to the center
of the pixel being textured. These can include
border texture elements, depending on the values of
GLTEXTUREWRAPS, GLTEXTUREWRAPT, and
GLTEXTUREWRAPREXT, and on the exact mapping.
GLLINEARDETAILSGIS
Returns a weighted average of samples from the
current 2D texture and from the current 2D detail
texture, for all four color components.
GLLINEARDETAILALPHASGIS
Returns a weighted average of samples from the
current 2D texture and from the current 2D detail
texture for the alpha color component; the other
three color components are returned as for GLLINEAR.
Page 5
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
GLLINEARDETAILCOLORSGIS
Returns a weighted average of samples from the
current 2D texture and from the current 2D detail
texture for the red, green, and blue color
components; the alpha color component is returned as
for GLLINEAR.
GLLINEARSHARPENSGIS
Returns an extrapolation derived from level zero and
level one texture image samples. This is similar to
GLLINEAR filtering, but with less blurring.
GLLINEARSHARPENALPHASGIS
Returns a sharpened extrapolated value for the alpha
color component. All other color components are
returned as for GLLINEAR.
GLLINEARSHARPENCOLORSGIS
Returns sharpened extrapolated values for the red,
green, and blue color components. The alpha
component is returned as for GLLINEAR.
GLPIXELTEXGENQCEILINGSGIX
GLPIXELTEXGENQFLOORSGIX
GLPIXELTEXGENQROUNDSGIX
The SGIXimpactpixeltexture extension allows the
glPixelTexGenSGIX command to utilize a 4D texture
when there is no hardware support for linear
interpolation in the q coordinate. In this case the
application may get the desired result from a two-
pass operation; on the first pass the filter function
is set to ceiling with alpha-blending disabled,
followed by a second pass set to floor with the
appropriate blendfunction set. If a nearest-neighbor
mode is acceptable, a one-pass method can be used
with the filter set to round (the default).
Additional information about 4D pixel-texturing can
be found man pages for glPixelTexGenSGIX.
GLFILTER4SGIS
As with minification, returns a weighted average of
the four texture elements (in the 1D case) or the
sixteen texture elements (in the 2D case) that are
closest to the center of the pixel being textured.
These can include border texture elements, although
the behavior in such cases is rarely useful. The
weights are derived from a filter kernel specified by
the user; see glTexFilterFuncSGIS. Note that this
Page 6
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
mode is not supported for 3D textures.
GLNEAREST is generally faster than GLLINEAR, but it can
produce textured images with sharper edges because the
transition between texture elements is not as smooth. The
default value of GLTEXTUREMAGFILTER is GLLINEAR.
See glDetailTexFuncSGIS for more explanation of the detail
texture magnification filters, and glSharpenTexFuncSGIS for
more explanation of the sharpen texture magnification filters.
GLTEXTUREWRAPS
Sets the wrap parameter for texture coordinate s to GLCLAMP,
GLREPEAT, GLCLAMPTOBORDERSGIS, or GLCLAMPTOEDGESGIS.
GLCLAMP 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. GLREPEAT causes the integer part
of the s coordinate to be ignored; the GL uses only the
fractional part, thereby creating a repeating pattern.
GLCLAMPTOBORDERSGIS is similar to GLCLAMP, but the s
coordinate range is adjusted slightly to ensure that the
texture border is fully accessed. GLCLAMPTOEDGESGIS is
also similar to GLCLAMP, but the s coordinate range is
adjusted slightly to ensure that the texture border is never
accessed. Border texture elements are accessed only if
wrapping is set to GLCLAMP. Initially, GLTEXTUREWRAPS is
set to GLREPEAT.
GLTEXTUREWRAPT
Sets the wrap parameter for texture coordinate t to GLCLAMP,
GLREPEAT, GLCLAMPTOBORDERSGIS, or GLCLAMPTOEDGESGIS.
See the discussion under GLTEXTUREWRAPS. Initially,
GLTEXTUREWRAPT is set to GLREPEAT.
GLTEXTUREWRAPREXT
Sets the wrap parameter for texture coordinate r to GLCLAMP,
GLREPEAT, GLCLAMPTOBORDERSGIS, or GLCLAMPTOEDGESGIS.
See the discussion under GLTEXTUREWRAPS. Initially,
GLTEXTUREWRAPREXT is set to GLREPEAT.
GLTEXTUREWRAPQSGIS
Sets the wrap parameter for texture coordinate q to GLCLAMP,
GLREPEAT, or GLCLAMPTOBORDERSGIS. See the discussion
under GLTEXTUREWRAPS, but note that the q coordinate wraps
only when the SGIStexture4D extension is being used.
Initially, GLTEXTUREWRAPQSGIS is set to GLREPEAT.
Page 7
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
GLTEXTUREBORDERCOLOR
Sets a border color. params 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).
GLDETAILTEXTURELEVELSGIS
Specifies the level of the detail texture image. Must be
negative. See glDetailTexFuncSGIS for more information.
GLDETAILTEXTUREMODESGIS
Specifies the detail texture mode. The permissible values are
GLADD and GLMODULATE. See glDetailTexFuncSGIS for more
information.
GLPOSTTEXTUREFILTERBIASSGIX
GLPOSTTEXTUREFILTERSCALESGIX
Specifies the bias and scale values for the texture. params
contains four values that comprise the R, G, B, and A bias
terms (in the case of GLPOSTTEXTUREFILTERBIASSGIX) or
scale factors (in the case of
GLPOSTTEXTUREFILTERSCALESGIX).
The scale, bias, and clamp to [0, 1] operations are applied, in
that order, directly before the texture environment equations,
or, if the SGItexturecolortable extension exists, directly
before the texture color lookup table. See glColorTableSGI for
more information about color lookup tables.
GLTEXTUREPRIORITYEXT
Specifies the texture residence priority. Permissible values
are in the range [0.0, 1.0]. See glPrioritizeTexturesEXT for
more information.
GLTEXTUREBASELEVELSGIS
GLTEXTUREMAXLEVELSGIS
The GL specification describes a ``complete'' set of mipmap
image arrays as array levels 0 through p, where p is a well-
defined function of the dimensions of the level 0 image
discussed under GLTEXTUREMINFILTER above. The level 0 image
is the base level (the highest-resolution image, with the
largest dimensions), and the level p image is the maximum level
(the lowest-resolution image, with the smallest dimensions, 1
by 1). To be used for texturing, all the levels of the
complete mipmap set must be loaded.
Page 8
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
The SGIStexturelod extension allows the base and maximum
levels to be redefined - the base level may be set to a value
greater than zero, and the maximum level may be set to a value
less than p. This permits a large texture to be loaded and
used initially at low resolution, and then at higher
resolutions as more data or texture loading time becomes
available. To be used for texturing, only the levels between
the base and maximum (inclusive) must be loaded. (Other levels
may be loaded, but only the levels from base through maximum
will be used.)
When pname is GLTEXTUREBASELEVELSGIS, param specifies the
base level of the mipmap set for the texture designated by
target. The default value is zero.
When pname is GLTEXTUREMAXLEVELSGIS, param specifies the
maximum level of the mipmap set for the texture designated by
target. The default value is 1000.
GLTEXTUREMINLODSGIS
GLTEXTUREMAXLODSGIS
When pixel fragments are being generated for a textured
primitive, a level-of-detail (LOD) is computed for each
fragment. The LOD is related to the number of texels that
contribute to the color of the fragment, and is used to select
the mipmap levels (see above) that participate in the fragment
color computation.
Normally the LOD is clamped to a range determined by the
filtering method and the base and maximum mipmap levels. When
the application changes the base or maximum mipmap levels, the
LOD range changes discontinuously, and the texture resolution
in rendered scenes appears to ``pop'' to a new value rather
than making a smooth transition. The SGIStexturelod
extension allows the LOD to be clamped to an arbitrary user-
defined range instead of the range implied by the base and
maximum mipmap levels. Because this clamping can be varied
continuously, the transition to a higher- or lower-resolution
texture can be accomplished smoothly.
When pname is GLTEXTUREMINLODSGIS, param specifies the new
minimum LOD value for the texture designated by target. The
default is -1000.
When pname is GLTEXTUREMAXLODSGIS, param specifies the new
maximum LOD value for the texture designated by target. The
default is 1000.
GLTEXTURELODBIASSSGIX
Page 9
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
GLTEXTURELODBIASTSGIX
GLTEXTURELODBIASRSGIX
Many textures have very low energy at high frequencies;
however, the LOD calculation has to assume the opposite. The
result is that mapped textures can appear excessively blurry in
one or more diminensions. The SGIXtexturelodbias extension
provides user-control over a texture dimension's influence on
the fragment LOD calculation. The bias specifies the number of
LODs (both integer and fractional) which should be added to the
LOD computed for the specified dimension. The fragment's final
LOD is a function of the LODs computed for each texture
dimension.
Some examples where this extension should be used follow.
Textures with non-power-of-two diminensions stretched to the
nearest power-of-two should have a bias between 0 and -1.0,
since the stretching didn't actually add any high frequency
information. Textures from filtered sources such as video are
often overfiltered differently in each dimension, and benefit
from separate negative biases for each dimension. A negative
bias can also be used to reduce one texture dimension's control
on the LOD or bluriness. This is helpful with a texture such as
a road which may appear too blurry when it is repeated many
times in one direction. Finally, a positive bias can be used to
intentionally make a texture appear blurrier.
When pname is GLTEXTURELODBIASSSGIX, param specifies bias
to add to the intermediate LOD calculated for the s dimension
designated by target. The default is 0.
When pname is GLTEXTURELODBIASTSGIX, param specifies bias
to add to the intermediate LOD calculated for the t dimension
designated by target. The default is 0.
When pname is GLTEXTURELODBIASRSGIX, param specifies bias
to add to the intermediate LOD calculated for the r dimension
designated by target. The default is 0.
GLDUALTEXTURESELECTSGIS
GLQUADTEXTURESELECTSGIS
On some Silicon Graphics machines with hardware texturing,
texel sizes must be a multiple of 16 bits. Most texture
internal formats simply occupy a multiple of 16 bits that is at
least as large as the format requested by the application,
leaving the remaining bits of each texel unused. The GLDUAL
and GLQUAD texture internal formats allow multiple textures
with small texels to be packed into the space of a single 16-
bit texture, thus making full use of texture memory. For
example, an 8-bit luminance texture would normally use a full
16 bits of texture memory for each texel, but if the
Page 10
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
application chooses the GLDUALLUMINANCE8SGIS internal
format, then two 8-bit luminance textures can be packed into
the same space.
Some Silicon Graphics machines with hardware texturing do not
have the above texel size restriction, but may benefit from
this extension by loading textures at a faster rate.
When such a texture is active, the application must select
which of the two packed textures will be used for drawing.
param specifies which is selected. For GLDUAL texture
storage formats, param assumes the value 0 or 1. For GLQUAD
texture storage formats, param assumes the value 0, 1, 2, or 3.
See glTexImage1D, glTexImage2D or glTexImage3DEXT for
information about loading dual and quad textures.
GLTEXTURECLIPMAPCENTERSGIX
A clipmap's region of interest is determined by some aspect of
the application; for example, it may be derived from an
observer's position in a terrain map. The application defines
the center of the region of interest by executing
glTexParameter with pname set to GLTEXTURECLIPMAPCENTERSGIX
and params pointing to an array with two elements. The first
element is the s coordinate of the center of the region of
interest in the level 0 texture image, and the second element
is the t coordinate of the center. (Note that the position
(s_center,t_center) at level 0 corresponds to the position
(s_center/2,t_center/2) at level 1, and so on as the level
number increases.) The coordinates of the center may be
changed at any time; for example, as an observer moves over a
terrain map.
GLTEXTURECLIPMAPFRAMESGIX
As the center of a clipmap's region of interest changes, it may
become necessary to load new texture image data into levels 0
through B-1 of the clipmap. This can be accomplished by
executing glTexSubImage2DEXT for each of the levels. However,
texture memory in addition to that used for the region of
interest is needed to store the new image data in each level.
This memory can be reserved by executing glTexParameter with
pname set to GLTEXTURECLIPMAPFRAMESGIX and param set to a
floating-point value in the range [0,1]. This reserves
param*D_s/2 texels on either side of the region of interest
along the s coordinate, and param*D_t/2 texels on either side
of the region of interest along the t coordinate, where D_s and
D_t are the dimensions of the region of interest in the s and t
directions, respectively. This additional memory is best
considered as a ``frame'' around the region of interest, where
param specifies the size of the frame as a fraction of the size
of the region of interest. The frame width may be changed at
any time.
Page 11
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
GLTEXTURECLIPMAPOFFSETSGIX
After new texture image data has been loaded into the frame
around a clipmap's region of interest, the region of interest
must be offset to incorporate the new data (and release the
memory occupied by old data that's no longer needed). This is
accomplished by adding offsets to all s and t coordinates used
to access the clipmap. These offsets may force coordinates to
wrap around, so they have the effect of mapping the texture
image and frame onto a torus. This behavior is useful for
continuous roaming through very large texture images. The
offsets are specified by executing glTexParameter with pname
set to GLTEXTURECLIPMAPOFFSETSGIX and params pointing to an
array with two elements. The first element is the offset to be
applied to s coordinates for the level 0 image, and the second
element is the offset to be applied to t coordinates for the
level 0 image. The coordinate offsets may be changed at any
time.
GLTEXTURECLIPMAPVIRTUALDEPTHSGIX
To utilize a texture of greater than GLMAXCLIPMAPDEPTHSGIX
levels of detail, additional parameters are provided to index
into a clipmap contained within a larger, virtual clipmap.
This clipmap is specified by executing glTexParameter with
pname set to GLTEXTURECLIPMAPVIRTUALDEPTHSGIX and params
pointing to an array with three elements. The first element,
known as the lod offset, is the level of detail in the virtual
clipmap corresponding to the base level of the smaller clipmap;
the second element is the depth of the smaller clipmap; and the
third element is the depth of the virtual clipmap.
These values can be changed at any time. For example, the
polygons in a scene that span more than
GLMAXCLIPMAPDEPTHSGIX levels can be divided into smaller
groups of polygons, each of which spans fewer than
GLMAXCLIPMAPDEPTHSGIX levels. The
GLTEXTURECLIPMAPVIRTUALDEPTHSGIX parameters are set before
the drawing of each group of polygons to ensure they only need
texels that are available in the active subregion of the
virtual clipmap.
Texture coordinates are relative to the base level of the
virtual clipmap, as are the clipmap center and offset (see
GLTEXTURECLIPMAPCENTERSGIX and
GLTEXTURECLIPMAPOFFSETSGIX above) and the minimum and
maximum levels of detail (see GLTEXTUREMINLODSGIS,
GLTEXTUREMAXLODSGIS, GLTEXTUREBASELEVELSGIS, or
GLTEXTUREMAXLEVELSGIS above).
Texel address and level of detail generation proceed with the
smaller clipmap precisely as described above for the non-
virtual clipmap. If the level of detail is such that a level
below the lod offset would be indexed, texture magnification is
Page 12
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
performed even though the finer texture information may be
resident in texture memory. Likewise, levels of detail coarser
than the lod offset plus the clipmap depth may demonstrate
aliasing. The application must choose
GLTEXTURECLIPMAPVIRTUALDEPTHSGIX parameters to prevent
unwanted filtering artifacts.
GLTEXTURECOMPARESGIX
GLTEXTURECOMPAREOPERATORSGIX
The SGIXshadow extension adds a new stage to the texturing
process. Once a texture value has been fetched from texture
memory, it may be compared with the iterated texture r
coordinate to determine if an object is in shadow. The result
of the comparison, rather than the texture value itself, is
sent to the filtering stage. If the test passes, the object is
considered to be in shadow; the result of the comparison is 0.
If the test fails, the result is 1. When used with textures
that consist of depth values (internal format
GLDEPTHCOMPONENT16SGIX, for example) and a properly-chosen
texture matrix, this can be used to implement shadows. The
comparison operation is enabled by executing glTexParameter
with pname set to GLTEXTURECOMPARESGIX and param set to the
value GLTRUE. (It is disabled by using the value GLFALSE.)
The comparison operation is selected by executing
glTexParameter with pname set to
GLTEXTURECOMPAREOPERATORSGIX and param set to the value
GLTEXTURELEQUALRSGIX or GLTEXTUREGEQUALRSGIX. Note
that the texture values are treated as though they range from
0.0 through 1.0, just like depth values, so the r coordinates
chosen by the application must also fall in that range.
GLSHADOWAMBIENTSGIX
The SGIXshadowambient extension modifies the behavior of the
SGIXshadow extension slightly. When a texture comparison
implemented by SGIXshadow passes, SGIXshadowambient causes
the result to be the shadow ambient value rather than zero.
Larger shadow ambient values result in lighter shadows.
NOTES
Linear filtering accesses the four nearest texture elements only in 2D
textures. In 1D textures, linear filtering accesses the two nearest
texture elements. In 3D textures, linear filtering accesses the eight
nearest texture elements.
Suppose texturing is enabled (by calling glEnable with argument
GLTEXTURE1D, GLTEXTURE2D, or GLTEXTURE3DEXT) and
GLTEXTUREMINFILTER is set to one of the functions that requires a
mipmap. If either the dimensions of the texture images currently defined
(with previous calls to glTexImage1D, glTexImage2D, or glTexImage3DEXT)
do not follow the proper sequence for mipmaps (described above), or there
are fewer texture images defined between the base and maximum levels than
Page 13
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
are needed, or the set of texture images have differing numbers of
texture components, then it is as if texture mapping were disabled.
A similar consideration applies for clipmaps. The only difference is
that levels 0 through B of the clipmap must have the same dimensions,
rather than varying by a factor of two for each successive level. Note
that the parameter B is never specified explicitly by the application; it
is inferred from the level at which the texture image dimensions stop
changing. (Recall that the dimensions for each level are provided as
arguments to the glTexImage command.)
The maximum number of levels in a clipmap is limited; the limit can be
determined by calling glGet with argument GLMAXCLIPMAPDEPTHSGIX.
The maximum number of levels in a virtual clipmap is limited; the limit
can be determined by calling glGet with argument
GLMAXCLIPMAPVIRTUALDEPTHSGIX.
GLTEXTUREMINLODSGIS, GLTEXTUREMAXLODSGIS,
GLTEXTUREBASELEVELSGIS, and GLTEXTUREMAXLEVELSGIS are part of the
SGIStexturelod extension. GLFILTER4SGIS is part of the
SGIStexturefilter4 extension. GLTEXTUREPRIORITYEXT is part of the
EXTtextureobject extension. GLPOSTTEXTUREFILTERBIASSGIX and
GLPOSTTEXTUREFILTERSCALESGIX are part of the SGIXtexturescalebias
extension. GLDUALTEXTURESELECTSGIS and GLQUADTEXTURESELECTSGIS
are part of the SGIStextureselect extension.
GLTEXTURECLIPMAPFRAMESGIX, GLTEXTURECLIPMAPCENTERSGIX,
GLTEXTURECLIPMAPOFFSETSGIX, and GLTEXTURECLIPMAPVIRTUALDEPTHSGIX
are part of the SGIXclipmap extension. GLCLAMPTOEDGESGIS is part of
the SGIStextureedgeclamp extension. GLCLAMPTOBORDERSGIS is part
of the SGIStextureborderclamp extension. GLTEXTURECOMPARESGIX and
GLTEXTURECOMPAREOPERATORSGIX are part of the SGIXshadow extension.
GLSHADOWAMBIENTSGIX is part of the SGIXshadowambient extension.
GLPIXELTEXGENQCEILINGSGIX, GLPIXELTEXGENQFLOORSGIX, and
GLPIXELTEXGENQROUNDSGIX are part of the SGIXimpactpixeltexture
extension. GLTEXTURELODBIASSSGIX, GLTEXTURELODBIASTSGIX, and
GLTEXTURELODBIASRSGIX are part of the SGIXtexturelodbias
extension. See glIntro for more information about using extensions.
ERRORS
GLINVALIDENUM is generated when target or pname is not one of the
accepted defined values, or when param should have a defined constant
value (based on the value of pname) and does not.
GLINVALIDVALUE is generated if an attempt is made to set
GLTEXTUREBASELEVELSGIS or GLTEXTUREMAXLEVELSGIS to a negative
value.
GLINVALIDVALUE is generated if pname is GLTEXTURECLIPMAPCENTERSGIX
and either of the two values specified by params is negative.
Page 14
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
GLINVALIDVALUE is generated if pname is GLTEXTURECLIPMAPOFFSETSGIX
and either of the two values specified by params is negative.
GLINVALIDVALUE is generated if pname is
GLTEXTURECLIPMAPVIRTUALDEPTHSGIX and any of the three values
specified by params is negative.
GLINVALIDVALUE is generated if pname is
GLTEXTURECLIPMAPVIRTUALDEPTHSGIX and the sum of the first two values
specified by params is greater than the third.
GLINVALIDOPERATION is generated if glTexParameter is executed between
the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGetIntegerv with argument GLMAXCLIPMAPDEPTHSGIX
glGetIntegerv with argument GLMAXCLIPMAPVIRTUALDEPTHSGIX
glGetTexParameter
glGetTexLevelParameter
MACHINE DEPENDENCIES
The SGIXclipmap extension is supported only on InfiniteReality systems.
The following restrictions apply:
1. For best performance, the ``breakpoint'' clipmap level (B) must
be loaded before any other level. The implementation derives
the size of the clipmap from the size of this level, so loading
this level first permits efficient allocation of texture memory.
2. Clipmaps must be square.
3. GLTEXTUREWRAPS and GLTEXTUREWRAPT must be set to
GLCLAMPTOEDGESGIS.
4. It is more efficient to set clipmap attributes that affect
texture memory allocation (such as
GLTEXTURECLIPMAPFRAMESGIX) before loading the first level of
the clipmap, rather than after loading it.
5. Virtual clipmaps (whose GLTEXTURECLIPMAPVIRTUALDEPTHSGIX
parameters have been defined) use texture memory inefficiently.
Each level of detail allocates a region of texture memory the
same size as that of a clipped level. Any clipmap whose depth
is less than GLMAXCLIPMAPDEPTHSGIX should avoid this by not
specifying GLTEXTURECLIPMAPVIRTUALDEPTHSGIX parameters. An
application can not readback the texture levels whose size is
smaller than that of the clipped level.
6. The depth of the virtual clipmap given in
GLTEXTURECLIPMAPVIRTUALDEPTHSGIX must be defined before any
texture levels are downloaded, and it can not be changed once it
Page 15
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
has been specified. If the application tries to change the
virtual depth, no action is taken.
7. Subloading texture into a portion of level B+1 of a virtual
clipmap (the first level coarser than the breakpoint) is
undefined; however, the entire level can be subloaded.
8. When using virtual clipmaps, an application should not
overcommit texture memory. Doing so will result in undefined
behavior.
On RealityEngine, RealityEngine2, and VTX systems
GLDETAILTEXTURELEVELSGIS must be less than or equal to 4.
On High Impact and Maximum Impact systems, the following restrictions
apply to detail texturing:
1. When detail texturing, the GLTEXTUREMINFILTER must specify
mipmapping; if not, the detail will be effectively disabled.
2. When specifying GLTEXTUREMAGFILTER, the only mode supported
is GLLINEARDETAILSGIS.
3. When specifying GLDETAILTEXTUREMODESGIS, the only mode
supported is GLADD.
4. When specifying GLDETAILTEXTURELEVELSGIS, any values outside
of the range [-2..-6] will be clamped to the limits of that
range.
Detail texturing acts as if the mipmap stack were extended by a number of
levels equal to the absolute value of the GLDETAILTEXTURELEVELSGIS
parameter. The number of normal mipmap levels plus the number of detail
levels must not exceed the maximum number of levels that can be supported
on the hardware. For example, on InfiniteReality systems the maximum
number of levels is 15. A detail texture at level -4 could be supported
on a base texture of size 2K (that is, a base texture with 11 levels) but
not on a base texture that is larger than 2K (one with 12 or more
levels). Failure to observe this constraint causes detail textures to
swim or jitter.
The SGIXshadow extension is supported only on InfiniteReality systems.
The SGIXshadowambient extension is supported only on InfiniteReality
systems.
The SGIStexturelod extension is supported on High Impact and Maximum
Impact systems; however, setting the GLTEXTUREMAXLODSGIS will have no
effect.
Page 16
glTexParameter(3G) OpenGL Reference glTexParameter(3G)
GLCLAMPTOBORDERSGIS is supported only on High Impact and Maximum
Impact systems.
GLCLAMPTOEDGESGIS is supported only on InfiniteReality systems and on
O2 systems.
Texture borders are not supported on InfiniteReality systems, so the
border width should always be zero. Applications should use the texture
wrap mode GLCLAMPTOEDGESGIS to obtain behavior similar to that of
borders.
GLCLAMP and GLCLAMPTOBORDERSGIS modes are not supported on O2
systems, and when set will produce the same clamping result as the
GLCLAMPTOEDGESGIS wrap mode.
On InfiniteReality systems, if the post-texture filter scale and bias
values are set to values other than the defaults, they are limited to the
range [0.0, 1.0). (note: this range excludes 1.0.) The
SGIXtexturescalebias extension is not supported on RealityEngine,
RealityEngine2, and VTX systems or on High Impact and Maximum Impact
systems.
The SGIStextureselect extension is supported only on InfiniteReality
systems, High Impact and Maximum Impact on Octane systems, and High
Impact and Maximum Impact on Indigo2 systems with the TRAM option card.
The SGIStexturefilter4 extension is supported only on InfiniteReality
systems.
On InfiniteReality systems, GLINVALIDVALUE is generated if the value of
the argument n to the command glTexFilterFuncSGIS does not equal the
value of the implementation dependent constant Size, which can be
determined by calling glGetTexParameter with argument
GLTEXTUREFILTER4SIZESGIS. This restriction will be removed in a
future release.
SEE ALSO
glDetailTexFuncSGIS, glIntro, glSharpenTexFuncSGIS,
glPrioritizeTexturesEXT, glTexEnv, glTexFilterFuncSGIS, glTexImage1D,
glTexImage2D, glTexImage3DEXT, glTexGen. glPixelTexGen.
Page 17