glTexEnv(3G)

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

As shipped in IRIX 6.5. First release of IRIX 6.5.

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


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


PARAMETERS
     target  Specifies a texture environment.  Must be GL_TEXTURE_ENV.

     pname   Specifies the symbolic name of a single-valued texture
             environment parameter.  Must be GL_TEXTURE_ENV_MODE.

     param   Specifies a single symbolic constant, one of GL_MODULATE,
             GL_DECAL, GL_BLEND, GL_REPLACE, GL_REPLACE_EXT, or GL_ADD.

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


PARAMETERS
     target
          Specifies a texture environment.  Must be GL_TEXTURE_ENV.

     pname
          Specifies the symbolic name of a texture environment parameter.
          Accepted values are GL_TEXTURE_ENV_MODE, GL_TEXTURE_ENV_COLOR, and
          GL_TEXTURE_ENV_BIAS_SGIX.

     params
          Specifies a pointer to a parameter array that contains either a
          single symbolic constant or an RGBA color.

DESCRIPTION
     A texture environment specifies how texture values are interpreted when a
     fragment is textured.  target must be GL_TEXTURE_ENV.  pname can be
     GL_TEXTURE_ENV_MODE, GL_TEXTURE_ENV_COLOR, or GL_TEXTURE_ENV_BIAS_SGIX.

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

     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 tables show how
     the RGBA color is produced for each of the texture functions.  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, the
     subscript b to the texture environment bias 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 and glTexImage2D).  In an image of GL_LUMINANCE format L
                                                                          t
     indicates the single component.  In an image of GL_ALPHA format A
                                                                      t
     indicates the single component.  In an image of GL_INTENSITY format I
                                                                          t
     indicates the single component.  A two-component image uses L  and A .  A
                                                                  t      t
     three-component image has only a color value, C .  A four-component image
                                                    t
     has both a color value C  and an alpha value A .  If a color triple is
                             t                     t
     shown to be equal to a single component format, this denotes that each
     component of the color triple is set equal to the single component.
     Similarly when 2 color triples are shown as being multiplied, this
     denotes that each component of the first triple is multiplied by the
     corresponding component of the second triple.

          number of                    texture functions
          components       GL_MODULATE       GL_DECAL           GL_BLEND
      ______________________________________________________________________
         GL_LUMINANCE        C =L C                         C =(1-L )C +L C
                              v  t f                         v     t  f  t c
              1               A =A          undefined            A =A
                               v  f                               v  f
      ______________________________________________________________________

           GL_ALPHA           C =C                               C =C
                               v  f                               v  f
                             A =A A         undefined           A =A A
                              v  t f                             v  t f
      ______________________________________________________________________

         GL_INTENSITY        C =I C                         C =(1-I )C +I C
                              v  t f                         v     t  f  t c
                             A =I A         undefined       A =(1-I )A +I A
                              v  t f                         v     t  f  t c
      ______________________________________________________________________

      GL_LUMINANCE_ALPHA     C =L C                         C =(1-L )C +L C
                              v  t f                         v     t  f  t c
              2              A =A A         undefined           A =A A
                              v  t f                             v  t f
      ______________________________________________________________________

            GL_RGB           C =C C           C =C          C =(1-C )C +C C
                              v  t f           v  t          v     t  f  t c
              3               A =A            A =A               A =A
                               v  f            v  f               v  f
      ______________________________________________________________________

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

                    number of           texture functions
                    components       GL_REPLACE_EXT      GL_ADD
                ___________________________________________________
                   GL_LUMINANCE          C =L         C =C +L C +C
                                          v  t         v  f  t c  b
                        1                A =A             A =A
                                          v  f             v  f
                ___________________________________________________

                     GL_ALPHA            C =C             C =C
                                          v  f             v  f
                                         A =A            A =A A
                                          v  t            v  t f
                ___________________________________________________

                   GL_INTENSITY          C =I         C =C +I C +C
                                          v  t         v  f  t c  b
                                         A =I         A =A +I A +A
                                          v  t         v  f  t c  b
                ___________________________________________________

                GL_LUMINANCE_ALPHA       C =L         C =C +L C +C
                                          v  t         v  f  t c  b
                        2                A =A            A =A A
                                          v  t            v  t f
                ___________________________________________________

                      GL_RGB             C =C         C =C +C C +C
                                          v  t         v  f  t c  b
                        3                A =A             A =A
                                          v  f             v  f
                ___________________________________________________

                     GL_RGBA             C =C         C =C +C C +C
                                          v  t         v  f  t c  b
                        4                A =A            A =A A
                                          v  t            v  t 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  takes these four values.
                                                c

     If pname is GL_TEXTURE_ENV_BIAS_SGIX, 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  takes these four
                                                           b
     values.

     GL_TEXTURE_ENV_MODE defaults to GL_MODULATE, GL_TEXTURE_ENV_COLOR
     defaults to (0,0,0,0), and GL_TEXTURE_ENV_BIAS_SGIX defaults to
     (0,0,0,0).

NOTES
     GL_REPLACE may only be used if the GL version is 1.1 or greater.
     GL_REPLACE_EXT is part of the EXT_texture extension.  GL_ADD and
     GL_TEXTURE_ENV_BIAS_SGIX are part of the SGIX_texture_add_env extension.
     See glIntro for more information concerning extensions.

ERRORS
     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
     glGetTexEnv


MACHINE DEPENDENCIES
     RealityEngine, RealityEngine2, and VTX and High Impact and Maximum Impact
     systems do not support GL_REPLACE_EXT.

     With High Impact and Maximum Impact on Indigo2 systems, the GL_BLEND mode
     is supported for GL_LUMINANCE and GL_LUMINANCE_ALPHA textures only. High
     Impact and Maximum Impact on Octane systems supports all but GL_RGBA.
     Specifying this mode for the unsupported texture formats will result in
     texture-mapping being effectively disabled.

     The SGIX_texture_add_env extension is supported only on InfiniteReality
     systems.  There is a significant restriction on the texture environment
     bias color, however.  Only two values are allowed for the bias:  zero, or
     exactly -0.5 times the texture environment color.  (This makes the
     expression C C +C  equivalent to C C  or (C -0.5)C , respectively.)
                 t c  b                t c      t      c


SEE ALSO
     glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D,
     glCopyTexSubImage2D, glTexImage1D, glTexImage2D, glTexParameter,
     glTexSubImage1D, glTexSubImage2D