Name
gl.TexEnv -- set texture environment parameters
Synopsis
gl.TexEnv(pname, param)
Function
A texture environment specifies how texture values are interpreted when a fragment is textured. pname can be either #GL_TEXTURE_ENV_MODE or #GL_TEXTURE_ENV_COLOR. If pname is #GL_TEXTURE_ENV_MODE, then param must be 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 gl.TexParameter for details.) and produces an RGBA color for that fragment. See an OpenGL reference manual for information on how the RGBA color is produced for each of the three texture functions that can be chosen.

If pname is #GL_TEXTURE_ENV_COLOR, param must be a table containing an array that holds an RGBA color consisting of four floating-point values.

#GL_TEXTURE_ENV_MODE defaults to #GL_MODULATE and #GL_TEXTURE_ENV_COLOR defaults to (0, 0, 0, 0)

Please consult an OpenGL reference manual for more information.

Inputs
pname
specifies the symbolic name of a texture environment parameter (see above)
param
table or single value specifying the parameter
Errors
#GL_INVALID_ENUM is generated when pname is not one of the accepted defined values, or when param should have a defined constant value (based on the value of pname) and does not.

#GL_INVALID_OPERATION is generated if gl.TexEnv() is executed between the execution of gl.Begin() and the corresponding execution of gl.End().

Associated gets
gl.GetTexEnv()


Show TOC