![]() -> Click here to learn how to get live help <- |
GLTEXENVIndexNAMEglTexEnvf, glTexEnvi, glTexEnvfv, glTexEnviv - set texture environment parametersC SPECIFICATIONvoid f3glTexEnvffP( GLenum fItargetfP,GLenum fIpnamefP, GLint fIparamfP ) PARAMETERS
C SPECIFICATIONvoid f3glTexEnvfvfP( GLenum fItargetfP,GLenum fIpnamefP, const GLint fI*paramsfP ) PARAMETERS
DESCRIPTIONA texture environment specifies how texture values are interpreted when a fragment is textured. f2targetfP must be %f3GL_TEXTURE_ENVfP. f2pnamefP can be either %f3GL_TEXTURE_ENV_MODEfP or %f3GL_TEXTURE_ENV_COLORfP. If f2pnamefP is %f3GL_TEXTURE_ENV_MODEfP, then f2paramsfP is (or points to) the symbolic name of a texture function. Four texture functions may be specified: %f3GL_MODULATEfP, %f3GL_DECALfP, %f3GL_BLENDfP, and %f3GL_REPLACEfP. A texture function acts on the fragment to be textured using the texture image value that applies to the fragment (see %f3glTexParameterfP) 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 %f3glTexImage1DfP, %f3glTexImage2DfP, %f3glTexImage3DfP, %f3glCopyTexImage1DfP, and %f3glCopyTexImage2DfP). In a one-component image, $L sub t$ indicates that single component. A two-component image uses $L sub t$ and $A sub t$. A three-component image has only a color value, $C sub t$. A four-component image has both a color value $C sub t$ and an alpha value $A sub t$.
NOTES%f3GL_REPLACEfP 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. When the %f3GL_ARB_multitexturefP extension is supported, %f3glTexEnvfP controls the texture environment for the current active texture unit, selected by %f3glActiveTextureARBfP. %f3GL_INVALID_ENUMfP is generated when f2targetfP or f2pnamefP is not one of the accepted defined values, or when f2paramsfP should have a defined constant value (based on the value of f2pnamefP) and does not. %f3GL_INVALID_OPERATIONfP is generated if %f3glTexEnvfP is executed between the execution of %f3glBeginfP and the corresponding execution of %f3glEndfP.ASSOCIATED GETS%f3glGetTexEnvfPSEE ALSO%f3glActiveTextureARB(3G)fP, %f3glCopyPixels(3G)fP, %f3glCopyTexImage1D(3G)fP, %f3glCopyTexImage2D(3G)fP, %f3glCopyTexSubImage1D(3G)fP, %f3glCopyTexSubImage2D(3G)fP, %f3glCopyTexSubImage3D(3G)fP, %f3glTexImage1D(3G)fP, %f3glTexImage2D(3G)fP, %f3glTexImage3D(3G)fP, %f3glTexParameter(3G)fP, %f3glTexSubImage1D(3G)fP, %f3glTexSubImage2D(3G)fP, %f3glTexSubImage3D(3G)fP
Index | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||