How to handle more texture units than allowed

How exactly do you handle rendering more texture units than the card supports. I have heard “fall back to multipass rendering” but other than alpha blending one layer onto another I am unsure how to achieve this.

Can someone enlighten me?

You draw the polygon as normal with the first textures.
You then bind the new textures.
Enable glBlend and choose the correct blend function (the options are listed in section 4.1.7 in the gl Spec document)
Draw the polygon again with the new textures.
Disable gl_Blend

or in code form:


//Draw normally here

//change the texture env (fiddle with them until you get the right effect
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_DECAL);

//change the blend function to the wanted effect
//this one is a double modulate blend
//you should be able to get all of the same glTexEnv's you can get in single pass rendering with diffrent blend functions
gl.glBlendFunc(GL.GL_DST_COLOR, GL.GL_SRC_COLOR);
//enable blending
gl.glEnable (GL.GL_BLEND);

//bind new textures

//draw the polygon again here

gl.glDisable (GL.GL_BLEND);

Thanks a bunch!