Multitexturing allows the use of multiple textures at one time.
It is a standard feature of OpenGL 1.3 and later.
An ordinary texture combines the base color of a polygon 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 uses multiple texture units.
A texture unit is a part of the rendering pipeline that applies one texture to whatever is being drawn.
Each unit has a texture, a texture environment, and optional texgen mode.
Most current hardware has from 2 to 8 texture units.
To get the number of units available: glGetIntegerv(GL_MAX_TEXTURE_UNITS)
Texture units are named GL_TEXTURE0, GL_TEXTURE1, etc.
The unit names are used with two new functions.
In OpenGL 1.2 (including PyOpenGL), multitexturing is an ARB extension.
In this case, the names are slightly different.
To use the multitexture extension in PyOpenGL:
from OpenGL.GL.ARB.multitexture import * ... glInitMultitextureARB()
glActiveTextureARB(GL_TEXTURE0_ARB) glEnable(GL_TEXTURE) glBindTexture(texid1) glActiveTextureARB(GL_TEXTURE1_ARB) glEnable(GL_TEXTURE) glBindTexture(texid2) ... glBegin(GL_QUADS) glTexCoord2f(0, 0) glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0, 0) glVertex3f(-5, -5, 0) ...