how do i shut down the multitexture engine?

Ok, so i’ve implemented multitexturing, but don’t know how to de-activate when i’m done.
I’ve implemented the operation:

(tex1+tex2)*color

where tex are the 2 textures (large-scale and detail), and color is used to do per vertex illumination.

I’m using this code to initialize the thing:

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);

The problem is that all the things I render after this get affected by multitexturing as well, but i want to “shutdown” the system and go back to plan 1-pass rendering. I’ve tried glDisables but no success so far.

Anyone can help me?

I think you simply need to:

glActiveTextureARB( GL_TEXTURE1_ARB );
glDisable( GL_TEXTURE_2D );

which is selecting the 2nd multi-texturing unit and then disabling it.

I’m not 100% though, I’m in the middle of writing the same logic… sounds like you’re 1 day ahead of me.

-Blake

Did you remember to disable the texture combiner? Texture unit 0 needs to be reset to GL_MODULATE instead of GL_COMBINE_EXT.

  • Tom