normal texturing doesn't work after multitexturing
I added some code to my project where I use multitexturing to bumpmap an object. This works fine, however, when I draw my regular objects (just one ms3d model atm) the textures don't get bound, and the already active texture is used instead.
For multitexturing, I use glActiveTexture(GL_TEXTURE0_ARB), and the same for texture unit 1 and 2. I bind the textures from my ms3d model using
glBindTexture(GL_TEXTURE_2D, texture);
glEnable(GL_TEXTURE_2D);
this is without any glActiveTexture call, so I made sure I disabled to texture unit 1 and 2 (and tried 0 as well).
However, I just can't get the textures to bind for the model when the multitexturing code is enabled in the workspace. Any idea how come? I can post code if needed.
try glpush attrib before and popattrib after multitexture to see if you forgot to restore some other opengl state. also, it could be a shader you used for bump mapping you forgot to turn off.
Quote:Original post by Subotron
I can get it to work that way, but I still don't know what I am doing wrong.
I had a similar problem a while ago but I'm not quite sure how it worked, I think I solved it using a glEnable/glDisable for each glActiveTexture()...
something like:
// Multitexturing...glActiveTexture(GL_TEXTURE0_ARB);glBindTexture(GL_TEXTURE_2D, texture1);glEnable(GL_TEXTURE_2D);//...glActiveTexture(GL_TEXTURE1_ARB);glBindTexture(GL_TEXTURE_2D, texture2);glEnable(GL_TEXTURE_2D);//...glDisable(GL_TEXTURE_2D); // disable for GL_TEXTURE1_ARBglActiveTexture(GL_TEXTURE0_ARB);glDisable(GL_TEXTURE_2D); // disable for GL_TEXTURE0_ARB//...// Use a single texture...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement