Multitexturing messing up normal texturing?
I have been looking to add multitexturing into my game engine and I have finally got it to work. However I only want multitexturing on the walls for the time being. I got it to work but as soon as I did all the rest of the textured objects now don''t work. I did this...
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, textureArray[6]);
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, textureArray[7]);
then called the multitexcoord for both of those textures. Those textures (the walls) rendered fine. However anything that I call after that as a normal texture...
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textureArray[2]);
shows up black and anything called before the multitexture one but in normal texturing is color distorted. Any clues on why this is? Do you disable multitexturing each time around? Any information would be helpful.
"understanding is a three-edged sword: your side, their side.. and the truth"
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization."
"The degree of technical competence is inversely proportional to the level of management."
"Any given program, when running, is obsolete."
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization."
"The degree of technical competence is inversely proportional to the level of management."
"Any given program, when running, is obsolete."
going to have to stick to multi texture once you start it
just activate (GL_TEXTURE0_ARB) and disable the others
just activate (GL_TEXTURE0_ARB) and disable the others
Game Core
Well then will I have to always do two textures even if I only want one? Can I Use the call...
glTexCoord2f(10.0f, 10.0f);
anymore? or do I always have to use...
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 5.0f, 5.0f);
and if i have to use the multitex one, can I do it with only one texture?
If not, would i have to make a solid white texture to put on top of it? It seems like that would be a waste.
glTexCoord2f(10.0f, 10.0f);
anymore? or do I always have to use...
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 5.0f, 5.0f);
and if i have to use the multitex one, can I do it with only one texture?
If not, would i have to make a solid white texture to put on top of it? It seems like that would be a waste.
"understanding is a three-edged sword: your side, their side.. and the truth"
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization."
"The degree of technical competence is inversely proportional to the level of management."
"Any given program, when running, is obsolete."
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization."
"The degree of technical competence is inversely proportional to the level of management."
"Any given program, when running, is obsolete."
use glMulti tex coord.
And you can use one texture just disable the rest.
Bobby
And you can use one texture just disable the rest.
Bobby
Game Core
BGCJR is right, you have to disable the 2nd Texture unit (GL_TEXTURE1_ARB). You do it like this:
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_[X]D, ...);
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_[X]D, ...);
//Render your walls
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_[X]D, ...);
//Render things without multitexturing here
You can use glTexCoord with multitexturing too, it only affects the first texture layer then. But I agree with BGCJR and would use glMultiTexCoord all the time when multitexturing is used. That''s much saver.
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_[X]D, ...);
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_[X]D, ...);
//Render your walls
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_[X]D, ...);
//Render things without multitexturing here
You can use glTexCoord with multitexturing too, it only affects the first texture layer then. But I agree with BGCJR and would use glMultiTexCoord all the time when multitexturing is used. That''s much saver.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement