Sign in to follow this  

normal texturing doesn't work after multitexturing

This topic is 3864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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_ARB
glActiveTexture(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_2D); // disable for GL_TEXTURE0_ARB

//...
// Use a single texture...


Share this post


Link to post
Share on other sites
that's the weird thing, that doesn't work here. Is it absolutely necessary to disable the textures by disabling the highest (e.g. when you have 3 texture units, 3 = the highest) texture first? Cause that might be the problem, although I don't think it is.

Share this post


Link to post
Share on other sites

This topic is 3864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this