NAME fglTexEnvf, fglTexEnvi, fglTexEnvfv, fglTexEnviv - set texture environment parameters FORTRAN SPECIFICATION SUBROUTINE fglTexEnvf( INTEGER*4 target, INTEGER*4 pname, REAL*4 param ) SUBROUTINE fglTexEnvi( INTEGER*4 target, INTEGER*4 pname, INTEGER*4 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, or GL_REPLACE. FORTRAN SPECIFICATION SUBROUTINE fglTexEnvfv( INTEGER*4 target, INTEGER*4 pname, CHARACTER*8 params ) SUBROUTINE fglTexEnviv( INTEGER*4 target, INTEGER*4 pname, CHARACTER*8 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 and GL_TEXTURE_ENV_COLOR. 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 either GL_TEXTURE_ENV_MODE or GL_TEXTURE_ENV_COLOR. 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 fglTexParameter) 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 fglTexImage1D, fglTexImage2D, fglCopyTexImage1D, and fglCopyTexImage2D). In a one- component image, L indicates that single component. A two-component image uses L and A . A three-component image has only a color value, C . A four-component image has both a color value C and an alpha value A . t t _______________________________________________________________________ |Base internal || Texture functions | | format ||GL_MODULATE GL_DECAL GL_BLEND GL_REPLACE | |______________||______________________________________________________| | GL_ALPHA || C =C | | C =C | C =C | | || A =A A | undefined | Av=Af | Av=Af | |______________||____________|_____________|______________|____________| |GL_LUMINANCE || C =L C | undefined | C =(1-L )C | C =L | | 1 || v t f | | v +L Ct f | v t | | || | | t c | | | || A =A | | A =A | A =A | |______________||____________|_____________|______________|____________| |GL_LUMINANCE || C =L C | undefined | C =(1-L )C | C =L | | _ALPHA || v t f | | v +L C f | v t | | 2 || | | t c | | | || A =A A | | A =A A | A =A | |______________||____________|_____________|______________|____________| |GL_INTENSITY || C =C I | undefined | C =(1-I )C | C =I | | || v f t | | v +I Ct f | v t | | || | | t c | | | || A =A I | | A =(1-I )A | A =I | | || v f t | | v +I At f | v t | |______________||____________|_____________|______________|____________| | GL_RGB || C =C C | C =C | C =(1-C C | C =C | | 3 || v t f | v t | v +C C) f | v t | | || | | t c | | | || A =A | A =A | A =A | A =A | |______________||____________|_____________|______________|____________| | GL_RGBA || C =C C | C =(1-A )C | C =(1-C C | C =C | | 4 || v t f | v +A Ct f | v +C C) f | v t | | || | t t | t c | | | || A =A A | A =A | A =A A | A =A | |______________||____________||_____________||______________||____________| 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 GL_TEXTURE_ENV_MODE defaults to GL_MODULATE and GL_TEXTURE_ENV_COLOR defaults to (0, 0, 0, 0). NOTES GL_REPLACE may only be used if the GL version is 1.1 or greater. Internal formats other than 1, 2, 3, or 4 may only be used if the GL version is 1.1 or greater. 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 fglTexEnv is executed between the execution of fglBegin and the corresponding execution of fglEnd. ASSOCIATED GETS fglGetTexEnv SEE ALSO fglCopyPixels, fglCopyTexImage1D, fglCopyTexImage2D, fglCopyTexSubImage1D, fglCopyTexSubImage2D, fglTexImage1D, fglTexImage2D, fglTexParameter, fglTexSubImage1D, fglTexSubImage2D