PDA

View Full Version : Multitexturing Conflicting with Single Texturing



Archimedes
01-01-2003, 06:17 PM
Hello,

I have been using single texturing for my terrain and models in my scene.

I then decided to add multitexturing for the terrain, which works fine.

But, somehow the single texturing no longer works. The models are no longer textured, nor is the skybox.

Somehow I've got to be able to activate and deactivate the multitexturing when I need it. But, I'm not sure how. I suppose I could implement multitexturing for everything, but would prefer to keep the code as is if possible. Any feedback would be appreciated.

Thanks!

Below is part of the code I'm using for the terrain.




renderTerrain() {
lActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, g_oTM.getTex(textureIdx0));
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, g_oTM.getTex(textureIdx1));
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);

//Render Triangle Strips Here
}

chxfryer
01-01-2003, 08:00 PM
lActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);

when you want to disable multitexturing

Archimedes
01-01-2003, 08:26 PM
Thanks, chxfryer, but I'd tried that first, and it had no effect. :p