PDA

View Full Version : Multitexturing



MasTrO
02-20-2002, 02:48 PM
HIii
I have a probleme to disable multitexturing.

this is what i do :
....
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,Tex1);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,Tex2);

glBegin(GL_QUADS);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB,0,0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,0);
glVertex2f(0,0);
......
glEnd();

glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_2D);

glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
........

It works fine but texturing doesn't work
on everything else i want to draw

thank youuuuu

chowe6685
02-20-2002, 05:41 PM
you have disabled texturing on all texture units, to use "normal" terturing just leave GL_TEXTURE_2D enabled on texture unit 0

Diapolo
02-20-2002, 06:06 PM
You could try this:

glPushAttrib(GL_TEXTURE_BIT);

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, Tex1);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, Tex2);

glBegin(GL_QUADS);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0, 0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0, 0);
glVertex2f(0, 0);
......
glEnd();

glPopAttrib();

Perhaps that solves your problems http://www.opengl.org/discussion_boards/ubb/smile.gif.

Diapolo

MasTrO
02-21-2002, 05:04 AM
ok
it works fine,
thank you !!!!