*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> glTexEnv (3)              



NAME    [Toc]    [Back]

       glTexEnv,  glTexEnvf,  glTexEnvi, glTexEnvfv, glTexEnviv -
       set texture environment parameters

SYNOPSIS    [Toc]    [Back]

       void glTexEnvf(
               GLenum target,
               GLenum pname,
               GLfloat param ); void glTexEnvi(
               GLenum target,
               GLenum pname,
               GLint param );

PARAMETERS    [Toc]    [Back]

       Specifies a texture environment. Must  be  GL_TEXTURE_ENV.
       Specifies  the  symbolic  name  of a single-valued texture
       environment parameter. Must be GL_TEXTURE_ENV_MODE.  Specifies
  a  single  symbolic  constant,  one of GL_MODULATE,

SYNOPSIS    [Toc]    [Back]

       void glTexEnvfv(
               GLenum target,
               GLenum pname,
               const GLfloat *params ); void glTexEnviv(
               GLenum target,
               GLenum pname,
               const GLint *params );

PARAMETERS    [Toc]    [Back]

       Specifies a texture environment. Must  be  GL_TEXTURE_ENV.
       Specifies  the  symbolic  name  of  a  texture environment
       parameter. Accepted  values  are  GL_TEXTURE_ENV_MODE  and
       GL_TEXTURE_ENV_COLOR.   Specifies a pointer to a parameter
       array that contains either a single symbolic  constant  or
       an RGBA color.

DESCRIPTION    [Toc]    [Back]

       A  texture  environment  specifies  how texture values are
       interpreted when a fragment is textured.  target  must  be
       GL_TEXTURE_ENV.   pname  can be either GL_TEXTURE_ENV_MODE

       If pname is GL_TEXTURE_ENV_MODE, then params is (or points
       to)  the symbolic name of a texture function. Four texture
       functions  may  be   specified:   GL_MODULATE,   GL_DECAL,
       GL_BLEND, and GL_REPLACE.

       A  texture  function  acts  on the fragment to be textured
       using the texture image value that applies to the fragment
       (see glTexParameter()) and produces an RGBA color for that
       fragment. The following table shows how the RGBA color  is
       produced  for each of the three texture functions that can
       be chosen.  C is a triple of color values (RGB) and  A  is
       the  associated  alpha value. RGBA values extracted from a
       texture image are in the  range  [0,1].  The  subscript  f
       refers  to  the  incoming fragment, the subscript t to the
       texture image, the subscript c to the texture  environment
       color,  and  subscript v indicates a value produced by the
       texture function.

       A texture image can have up to four components per texture
       element   (see  glTexImage1D(),  glTexImage2D(),  glTexImage3D(),
 glCopyTexImage1D(), and glCopyTexImage2D()). In a
       one-component image, L[t] indicates that single component.
       A two-component image uses L[t] and A[t].  A  three-component
  image has only a color value, C[t]. A four-component
       image has both a color value C[t] and an alpha value A[t].

       Base inter-                    Texture       Functions
       format        GL_MODULATE      GL_DECAL      GL_BLEND          GL_REPLACE
       GL_ALPHA      C[v]         =   undefined     C[v]          =   C[v]       =
                     C[f]A[v]     =                 C[f]A[v] = A[f]   C[f]A[v]   =
                     A[f] A[t]                                        A[t]

       GL_LUMI-      C[v]  =   L[t]   undefined     C[v] =  (  1  -   C[v] =  L[t]
       NANCE   (or   C[f]   A[v]  =                 L[t]  )  C[f] +   A[v] = A[f]
       1)            A[f]                           L[t] C[c]
                                                     A[v] = A[f]

       GL_LUMI-      C[v]   =  L[t]   undefined     C[v]  =  (  1 -   C[v] =  L[t]
       NANCE_ALPHA   C[f]  A[v]   =                 L[t] ) C[f]       A[v] = A[t]
       (or 2)        A[t] A[f]                       +  L[t]   C[c]
                                                    A[v]   =   A[t]

       GL_INTEN-     C[v]  =   C[f]   undefined     C[v] =  (  1  -   C[v]  = I[t]
       SITY          I[t]   A[v]  =                 I[t]  )  C[f] +   A[v] = I[t]
                     A[f] I[t]                      I[t] C[c]  A[v]
                                                    =  ( 1 - I[t] )
                                                    A[f]   +   I[t]

       GL_RGB  (or   C[v]   =  C[t]   C[v] = C[t]   C[v]   =  (1  -   C[v] =  C[t]
       3)            C[f]  A[v]   =   A[v] = A[f]   C[t])  C[f]   +   A[v] = A[f]
                     A[f]                           C[t]  C[c] A[v]
                                                    = A[f]

       GL_RGBA (or   C[v]  =   C[t]   C[v] = (  1   C[v]  =  (1   -   C[v]  = C[t]
       4)            C[f]   A[v]  =   -     A[t])   C[t]) C[f]        A[v] = A[t]
                     A[t] A[f]        C[f] + A[t]    +   C[t]  C[c]
                                      C[t] A[v] =   A[v]   =   A[t]
                                      A[f]          A[f]


       If pname is GL_TEXTURE_ENV_COLOR,params is a pointer to an
       array  that holds an RGBA color consisting of four values.
       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. C[c] takes these
       four values.

 defaults to (0, 0, 0, 0).

NOTES    [Toc]    [Back]

       GL_REPLACE  may  only  be used if the GL version is 1.1 or

       Internal formats other than 1, 2, 3, or 4 may only be used
       if the GL version is 1.1 or greater.

       When   the  GL_ARB_multitexture  extension  is  supported,
       glTexEnv() controls the texture environment for  the  current
 active texture unit, selected byglActiveTextureARB().
       GL_INVALID_ENUM is generated when target or pname  is  not
       one  of the accepted defined values, or when params should
       have a defined constant  value  (based  on  the  value  of
       pname) and does not.

       GL_INVALID_OPERATION is generated if glTexEnv()is executed
       between the execution of  glBegin()and  the  corresponding
       execution of glEnd().

ASSOCIATED GETS    [Toc]    [Back]


SEE ALSO    [Toc]    [Back]

       glActiveTextureARB(3),    glCopyPixels(3),    glCopyTexImage1D(3),   glCopyTexImage2D(3),   glCopyTexSubImage1D(3),
       glCopyTexSubImage2D(3),  glCopyTexSubImage3D(3),  glTexImage1D(3), glTexImage2D(3),  glTexImage3D(3),  glTexParameter(3),   glTexSubImage1D(3),  glTexSubImage2D(3),  glTexSubImage3D(3)

[ Back ]
 Similar pages
Name OS Title
glgettexenv IRIX return texture environment parameters
glGetTexEnviv Tru64 return texture environment parameters
glGetTexEnv Tru64 return texture environment parameters
glGetTexEnvfv Tru64 return texture environment parameters
tevbind IRIX selects a texture environment
tevdef IRIX defines a texture mapping environment
glTexParameter Tru64 set texture parameters
gltexparameter IRIX set texture parameters
glgettexgen IRIX return texture coordinate generation parameters
glGetTexGendv Tru64 return texture coordinate generation parameters
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service