next up previous contents
Next: 6.1.6 Texture Objects Up: 6.1 Texturing Basics Previous: 6.1.4.1 Additional Control of

6.1.5 Texture Environment

The process by which the final fragment color value is derived is called the texture environment function (glTexEnv()) Several methods exist for computing the final color, each capable of producing a particular effect. One of the most commonly used is the GL_MODULATE environment function. The modulate function multiplies or modulates the original fragment color with the texel color. Typically, applications generate polygons with per-vertex lighting enabled and then modulate the texture image with the fragment's interpolated lit color value to produce a lit, textured surface. The GL_REPLACE texture environment5 is even simpler. The replace function simply replaces the fragment's color with the color from the texture. The same effect as replace can be accomplished in OpenGL 1.1 by using the modulate environment with a constant white current color, though the replace function has a lower computational cost.

The GL_DECAL environment function performs simple alpha-blending between the fragment color and an RGBA texture; for RGB textures it simply replaces the fragment color. Decal mode is undefined for other texture formats (luminance, alpha, intensity). The GL_BLEND environment function uses the texture value to control the mix of the incoming fragment color and a constant texture environment color.

At the time of this writing, efforts are underway to standardize extensions that enhance the texture environment by adding new functions. For example, there should be a way to add the texture color to the fragment color.


next up previous contents
Next: 6.1.6 Texture Objects Up: 6.1 Texturing Basics Previous: 6.1.4.1 Additional Control of
David Blythe
1999-08-06