Multitexturing

Multitexturing is the technique of using multiple textures at one time.

It is a common extension in OpenGL.

An ordinary texture combines the base color of a polygon (from glColor or from lighting) with color from the texture image. In multitexturing, this result of the first texturing can be combined with color from another texture.

Each texture can be applied with different texture coordinates.

+ +
=

Multitexturing is described as involving multiple texture units.
A texture unit is a part of the OpenGL rendering pipeline that applies a texture to whatever is being drawn.
Each texture unit has a texture, a texture environment, and optional texgen mode.

Most current graphics hardware has from 2 to 4 texture units.



The function

        glActiveTextureARB(texture_unit);

selects the current unit that will be affected by texture calls (such as glBindTexture and glTexEnv).

The texture coordinates to use for each texture unit are set using:

        glMuliTexCoord2f(texture_unit, s, t);

Examples:




next