GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


Manpage of GLTEXENV

GLTEXENV

Index
 

NAME

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

 

C SPECIFICATION

void f3glTexEnvffP( GLenum fItargetfP,
   GLenum fIpnamefP,
   GLint fIparamfP )

delim $$  

PARAMETERS

f2targetfP
Specifies a texture environment. Must be %f3GL_TEXTURE_ENVfP.
f2pnamefP
Specifies the symbolic name of a single-valued texture environment parameter. Must be %f3GL_TEXTURE_ENV_MODEfP.
f2paramfP
Specifies a single symbolic constant, one of %f3GL_MODULATEfP, %f3GL_DECALfP, %f3GL_BLENDfP, or %f3GL_REPLACEfP.
 

C SPECIFICATION

void f3glTexEnvfvfP( GLenum fItargetfP,
   GLenum fIpnamefP,
   const GLint fI*paramsfP )

 

PARAMETERS

f2targetfP
Specifies a texture environment. Must be %f3GL_TEXTURE_ENVfP.
f2pnamefP
Specifies the symbolic name of a texture environment parameter. Accepted values are %f3GL_TEXTURE_ENV_MODEfP and %f3GL_TEXTURE_ENV_COLORfP.
f2paramsfP
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. 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$.


Base internalTexture functions
%f3GL_MODULATEfP%f3GL_DECALfP%f3GL_BLENDfP%f3GL_REPLACEfP

%f3GL_ALPHAfP$C sub v ~=~ C sub f$undefined$C sub v ~=~ C sub f$$C sub v ~=~ C sub f$
^ $A sub v ~=~ A sub f A sub t$^$A sub v ~=~ A sub f$$A sub v ~=~ A sub t$

%f3GL_LUMINANCEfP$C sub v ~=~ L sub t C sub f$undefined$C sub v ~=~ ( 1 - L sub t ) C sub f$$C sub v ~=~ L sub t$
$+ L sub t C sub c$
1 $A sub v ~=~ A sub f$^ $A sub v ~=~ A sub f$$A sub v ~=~ A sub f$

%f3GL_LUMINANCEfP$C sub v ~=~ L sub t C sub f$undefined$C sub v ~=~ ( 1 - L sub t ) C sub f $$C sub v ~=~ L sub t$
_ALPHAfP $+ L sub t C sub c$
2$A sub v ~=~ A sub t A sub f$^$A sub v ~=~ A sub t A sub f$$A sub v ~=~ A sub t$

%f3GL_INTENSITYfP$C sub v ~=~ C sub f I sub t$undefined$C sub v ~=~ ( 1 - I sub t ) C sub f$ $C sub v ~=~ I sub t$
$+ I sub t C sub c$
c^ $A sub v ~=~ A sub f I sub t$^$A sub v ~=~ ( 1 - I sub t ) A sub f $$A sub v ~=~ I sub t$
$+ I sub t A sub c$

%f3GL_RGBfP$C sub v ~=~ C sub t C sub f$$C sub v ~=~ C sub t$$C sub v ~=~ (1 - C sub t) C sub f $$C sub v ~=~ C sub t$
$+ C sub t C sub c$
3$A sub v ~=~ A sub f$$A sub v ~=~ A sub f$$A sub v ~=~ A sub f$$A sub v ~=~ A sub f$

%f3GL_RGBAfP$C sub v ~=~ C sub t C sub f$$C sub v ~=~ ( 1 - A sub t ) C sub f $$C sub v ~=~ (1 - C sub t) C sub f $$C sub v ~=~ C sub t$
$+ A sub t C sub t$ $+ C sub t C sub c$
4$A sub v ~=~ A sub t A sub f$$A sub v ~=~ A sub f$$A sub v ~=~ A sub t A sub f$$A sub v ~=~ A sub t$

If f2pnamefP is %f3GL_TEXTURE_ENV_COLORfP, f2paramsfP 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 sub c$ takes these four values. %f3GL_TEXTURE_ENV_MODEfP defaults to %f3GL_MODULATEfP and %f3GL_TEXTURE_ENV_COLORfP defaults to (0, 0, 0, 0).  

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

%f3glGetTexEnvfP  

SEE 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

NAME
C SPECIFICATION
PARAMETERS
C SPECIFICATION
PARAMETERS
DESCRIPTION
NOTES
ASSOCIATED GETS
SEE ALSO