MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
GLTEXPARAMETER(3G)                                          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, or GLTEXTURE3D.

       pname   Specifies  the symbolic name of a single-valued texture parame-
               ter.  pname can be one of the following: GLTEXTUREMINFILTER,
               GLTEXTUREMAGFILTER,  GLTEXTUREMINLOD, GLTEXTUREMAXLOD,
               GLTEXTUREBASELEVEL, GLTEXTUREMAXLEVEL, GLTEXTUREWRAPS,
               GLTEXTUREWRAPT, GLTEXTUREWRAPR, or GLTEXTUREPRIORITY.

       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 or GLTEXTURE3D.

       pname  Specifies the symbolic name of a texture parameter.   pname  can
              be     one     of    the    following:    GLTEXTUREMINFILTER,
              GLTEXTUREMAGFILTER,  GLTEXTUREMINLOD,  GLTEXTUREMAXLOD,
              GLTEXTUREBASELEVEL,  GLTEXTUREMAXLEVEL, GLTEXTUREWRAPS,
              GLTEXTUREWRAPT,  GLTEXTUREWRAPR,  GLTEXTUREBORDERCOLOR,
              or GLTEXTUREPRIORITY.

       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) 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.

       glTexParameter assigns the value or values in  params  to  the  texture
       parameter  specified  as  pname.   target  defines  the target texture,
       either GLTEXTURE1D, GLTEXTURE2D, or GLTEXTURE3D.   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  ele-
                 ment.   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^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, subse-
                 quent mipmaps have dimension 1 x   2^(l-1)  or  2^(k-1)  x  1
                 until  the  final mipmap, which has dimension 1x1.  To define
                 the mipmaps, call glTexImage1D,  glTexImage2D,  glTexImage3D,
                 glCopyTexImage1D, or glCopyTexImage2D with the level argument
                 indicating the order of the mipmaps.  Level 0 is the original
                 texture; level max ( n, m ) is the final 1x1 mipmap.

                 params  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.

                 GLINEAR 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
                           GLTEXTUREWRAPS and GLTEXTUREWRAPT, 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 of the pixel) to  produce  a  texture
                           value.

                 GLINEARMIPMAPNEAREST
                           Chooses  the  mipmap  that most closely matches the
                           size of the  pixel  being  textured  and  uses  the
                           GLINEAR 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.

                 GLINEARMIPMAPLINEAR
                           Chooses the two mipmaps that most closely match the
                           size  of  the  pixel  being  textured  and uses the
                           GLINEAR 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 GLNEAREST and GLINEAR minification  functions  can  be
                 faster than the other four, they sample only one or four tex-
                 ture elements to determine the texture  value  of  the  pixel
                 being rendered and can produce moire patterns or ragged tran-
                 sitions.   The  initial  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 tex-
                 ture  element.  It sets the texture magnification function to
                 either GLNEAREST or GLINEAR  (see  below).  GLNEAREST  is
                 generally  faster than GLINEAR, but it can produce textured
                 images with sharper edges because the transition between tex-
                 ture  elements  is  not  as  smooth.   The  initial  value of
                 GLTEXTUREMAGFILTER is GLINEAR.

                 GLNEAREST
                           Returns the value of the texture  element  that  is
                           nearest  (in  Manhattan  distance) to the center of
                           the pixel being textured.

                 GLINEAR 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
                           GLTEXTUREWRAPS and GLTEXTUREWRAPT, and on the
                           exact mapping.



       GLTEXTUREMINLOD
                 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.


       GLTEXTUREMAXLOD
                 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.


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


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


       GLTEXTUREWRAPS
                 Sets  the  wrap  parameter for texture coordinate s to either
                 GLCLAMP, GLCLAMPTOEDGE, or GLREPEAT.  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.  GLCLAMPTOEDGE causes s coordinates to be
                 clamped to the range 1/2N, 1-1/2N, where N is the size of the
                 texture  in  the direction of clamping.  GLREPEAT causes the
                 integer part of the s coordinate to be ignored; the  GL  uses
                 only  the  fractional part, thereby creating a repeating pat-
                 tern.  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  either
                 GLCLAMP, GLCLAMPTOEDGE, or GLREPEAT.  See the discussion
                 under GLTEXTUREWRAPS.  Initially, GLTEXTUREWRAPT is set
                 to GLREPEAT.

       GLTEXTUREWRAPR
                 Sets  the  wrap  parameter for texture coordinate r to either
                 GLCLAMP, GLCLAMPTOEDGE, or GLREPEAT.  See the discussion
                 under GLTEXTUREWRAPS.  Initially, GLTEXTUREWRAPR is set
                 to GLREPEAT.

       GLTEXTUREBORDERCOLOR
                 Sets a border color.  params contains four values  that  com-
                 prise  the  RGBA  color of the texture border.  Integer color
                 components are interpreted linearly such that the most  posi-
                 tive  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).

       GLTEXTUREPRIORITY
                 Specifies the texture residence  priority  of  the  currently
                 bound  texture.   Permissible values are in the range [0, 1].
                 See glPrioritizeTextures and glBindTexture for more  informa-
                 tion.

NOTES
       GLTEXTURE3D,          GLTEXTUREMINLOD,         GLTEXTUREMAXLOD,
       GLTEXTUREBASELEVEL, and GLTEXTUREMAXLEVEL are only  available  if
       the GL version is 1.2 or greater.

       Suppose  that a program has enabled texturing (by calling glEnable with
       argument GLTEXTURE1D, GLTEXTURE2D, or GLTEXTURE3D)  and  has  set
       GLTEXTUREMINFILTER  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,   glTexImage3D,
       glCopyTexImage1D,  or  glCopyTexImage2D)  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  dif-
       fering  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 GLARBmultitexture  extension  is  supported,  glTexParameter
       specifies the texture parameters for the active texture unit, specified
       by calling glActiveTextureARB.

ERORS
       GLINVALIDENUM is generated if target or  pname  is  not  one  of  the
       accepted defined values.

       GLINVALIDENUM  is  generated if params should have a defined constant
       value (based on the value of pname) and does not.

       GLINVALIDOPERATION is generated if glTexParameter is executed between
       the execution of glBegin and the corresponding execution of glEnd.

ASOCIATED GETS
       glGetTexParameter
       glGetTexLevelParameter

SEE ALSO
       glActiveTextureARB,   glBindTexture,   glCopyPixels,  glCopyTexImage1D,
       glCopyTexImage2D,       glCopyTexSubImage1D,       glCopyTexSubImage2D,
       glCopyTexSubImage3D,   glDrawPixels,   glPixelStore,   glPixelTransfer,
       glPrioritizeTextures, glTexEnv, glTexGen,  glTexImage1D,  glTexImage2D,
       glTexImage3D, glTexSubImage1D, glTexSubImage2D, glTexSubImage3D





                                                            GLTEXPARAMETER(3G)
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™