PDA

View Full Version : how do i shut down the multitexture engine?



aphex
04-25-2001, 03:19 PM
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?

bsenftner
04-25-2001, 04:34 PM
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. http://www.opengl.org/discussion_boards/ubb/wink.gif

-Blake

Tom Nuydens
04-25-2001, 11:33 PM
Did you remember to disable the texture combiner? Texture unit 0 needs to be reset to GL_MODULATE instead of GL_COMBINE_EXT.

- Tom