1GLTEXENV(3G)                                                      GLTEXENV(3G)
2
3
4

NAME

6       glTexEnvf,  glTexEnvi, glTexEnvfv, glTexEnviv - set texture environment
7       parameters
8
9

C SPECIFICATION

11       void glTexEnvf( GLenum target,
12                       GLenum pname,
13                       GLfloat param )
14       void glTexEnvi( GLenum target,
15                       GLenum pname,
16                       GLint param )
17
18

PARAMETERS

20       target  Specifies a texture environment.  Must be GL_TEXTURE_ENV.
21
22       pname   Specifies the symbolic name of a single-valued texture environ‐
23               ment parameter.  Must be GL_TEXTURE_ENV_MODE.
24
25       param   Specifies  a  single  symbolic  constant,  one  of GL_MODULATE,
26               GL_DECAL, GL_BLEND, or GL_REPLACE.
27

C SPECIFICATION

29       void glTexEnvfv( GLenum target,
30                        GLenum pname,
31                        const GLfloat *params )
32       void glTexEnviv( GLenum target,
33                        GLenum pname,
34                        const GLint *params )
35
36

PARAMETERS

38       target Specifies a texture environment.  Must be GL_TEXTURE_ENV.
39
40       pname  Specifies the symbolic name of a texture environment  parameter.
41              Accepted       values      are      GL_TEXTURE_ENV_MODE      and
42              GL_TEXTURE_ENV_COLOR.
43
44       params Specifies a pointer to a parameter array that contains either  a
45              single symbolic constant or an RGBA color.
46

DESCRIPTION

48       A texture environment specifies how texture values are interpreted when
49       a fragment is textured.  target must be GL_TEXTURE_ENV.  pname  can  be
50       either GL_TEXTURE_ENV_MODE or GL_TEXTURE_ENV_COLOR.
51
52       If pname is GL_TEXTURE_ENV_MODE, then params is (or points to) the sym‐
53       bolic name of a texture function.  Four texture functions may be speci‐
54       fied: GL_MODULATE, GL_DECAL, GL_BLEND, and GL_REPLACE.
55
56       A  texture  function acts on the fragment to be textured using the tex‐
57       ture image value that applies to the fragment (see glTexParameter)  and
58       produces  an  RGBA  color for that fragment.  The following table shows
59       how the RGBA color is produced for each of the three texture  functions
60       that  can  be chosen.  C is a triple of color values (RGB) and A is the
61       associated alpha value.  RGBA values extracted from a texture image are
62       in  the  range [0,1].  The subscript f refers to the incoming fragment,
63       the subscript t to the texture image, the subscript c  to  the  texture
64       environment  color,  and  subscript v indicates a value produced by the
65       texture function.
66
67       A texture image can have up to four components per texture element (see
68       glTexImage1D,   glTexImage2D,   glTexImage3D,   glCopyTexImage1D,   and
69       glCopyTexImage2D).  In a one-component image, Lt indicates that  single
70       component.   A  two-component  image uses Lt and At.  A three-component
71       image has only a color value, Ct.  A four-component image  has  both  a
72       color value Ct and an alpha value At.
73
74
75        ──────────────────────────────────────────────────────────────────────
76        Base internal                 Texture functions
77                        GL_MODULATE    GL_DECAL       GL_BLEND     GL_REPLACE
78        ──────────────────────────────────────────────────────────────────────
79          GL_ALPHA         Cv=Cf       undefined       Cv=Cf         Cv=Cf
80                          Av=AfAt                      Av=Af         Av=At
81        ──────────────────────────────────────────────────────────────────────
82        GL_LUMINANCE      Cv=LtCf      undefined    Cv=(1−Lt)Cf      Cv=Lt
83                                                       +LtCc
84              1            Av=Af                        Av=Af        Av=Af
85        ──────────────────────────────────────────────────────────────────────
86        GL_LUMINANCE      Cv=LtCf      undefined    Cv=(1−Lt)Cf      Cv=Lt
87          \f3_ALPHA                                     +LtCc
88              2           Av=AtAf                     Av=AtAf        Av=At
89        ──────────────────────────────────────────────────────────────────────
90        GL_INTENSITY      Cv=CfIt      undefined    Cv=(1−It)Cf      Cv=It
91                                                       +ItCc
92             c            Av=AfIt                   Av=(1−It)Af      Av=It
93                                                       +ItAc
94        ──────────────────────────────────────────────────────────────────────
95           GL_RGB         Cv=CtCf        Cv=Ct      Cv=(1−Ct)Cf      Cv=Ct
96                                                        +CtCc
97              3            Av=Af         Av=Af         Av=Af         Av=Af
98        ──────────────────────────────────────────────────────────────────────
99           GL_RGBA        Cv=CtCf     Cv=(1−At)Cf   Cv=(1−Ct)Cf      Cv=Ct
100                                         +AtCt          +CtCc
101              4           Av=AtAf        Av=Af        Av=AtAf        Av=At
102        ──────────────────────────────────────────────────────────────────────
103       If  pname is GL_TEXTURE_ENV_COLOR, params is a pointer to an array that
104       holds an RGBA color consisting of four values.   Integer  color  compo‐
105       nents are interpreted linearly such that the most positive integer maps
106       to 1.0, and the most negative integer maps to  -1.0.   The  values  are
107       clamped  to  the  range  [0,1] when they are specified.  Cc takes these
108       four values.
109
110       GL_TEXTURE_ENV_MODE defaults to  GL_MODULATE  and  GL_TEXTURE_ENV_COLOR
111       defaults to (0, 0, 0, 0).
112

NOTES

114       GL_REPLACE may only be used if the GL version is 1.1 or greater.
115
116       Internal  formats  other  than 1, 2, 3, or 4 may only be used if the GL
117       version is 1.1 or greater.
118
119       When the GL_ARB_multitexture extension is supported, glTexEnv  controls
120       the  texture  environment for the current active texture unit, selected
121       by glActiveTextureARB.  GL_INVALID_ENUM is  generated  when  target  or
122       pname  is not one of the accepted defined values, or when params should
123       have a defined constant value (based on the value of  pname)  and  does
124       not.
125
126       GL_INVALID_OPERATION  is  generated if glTexEnv is executed between the
127       execution of glBegin and the corresponding execution of glEnd.
128

ASSOCIATED GETS

130       glGetTexEnv
131

SEE ALSO

133       glActiveTextureARB(3G),     glCopyPixels(3G),     glCopyTexImage1D(3G),
134       glCopyTexImage2D(3G), glCopyTexSubImage1D(3G), glCopyTexSubImage2D(3G),
135       glCopyTexSubImage3D(3G),      glTexImage1D(3G),       glTexImage2D(3G),
136       glTexImage3D(3G),        glTexParameter(3G),       glTexSubImage1D(3G),
137       glTexSubImage2D(3G), glTexSubImage3D(3G)
138
139
140
141
142                                                                  GLTEXENV(3G)
Impressum