Multi-Textuing and lighting

dmacnevin
Unregistered
 
Post: #1
Hey everyone,

I'm having some problems regarding mult-texturing. I have a simple object that I want to be able to apply 2 textures to. I have managed to get one texture applied to this object, and I have the code set up so that it will mult-texture.

The problem is that once I apply two textures to the object, I loose all lighting in the scene (I think this is what is happening.) Once I remove multi-texturing, the object is then black and I can't seem to figure out what is happening. I have tried to re-enable the lighting and also disable both textures but this does not seem to be working.

This is the code that I used to set up my textures
Code:
        glActiveTextureARB(GL_TEXTURE0_ARB);
        glBindTexture (GL_TEXTURE_2D, m_worldTextures[0]);
        glEnable(GL_TEXTURE_2D);
        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
        
        glActiveTextureARB(GL_TEXTURE1_ARB);
        glBindTexture (GL_TEXTURE_2D, m_worldTextures[1]);
        glEnable(GL_TEXTURE_2D);
        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
        glDisable(GL_LIGHTING);
I tried using this code to turn off both textures:
Code:
        glActiveTexture(GL_TEXTURE2);
        glDisable( GL_TEXTURE_2D );
        glActiveTexture(GL_TEXTURE1);
        glDisable( GL_TEXTURE_2D );

Does anyone have any ideas as to what could be causing the problem, or any links to information that might be helpful?

Thanks
Danielle
Quote this message in a reply
Hog
Member
Posts: 151
Joined: 2002.09
Post: #2
glActiveTexture(GL_TEXTURE2); -> glActiveTexture(GL_TEXTURE0_ARB);
glActiveTexture(GL_TEXTURE1); -> glActiveTexture(GL_TEXTURE1_ARB);
Quote this message in a reply
dmacnevin
Unregistered
 
Post: #3
Of course.....it was that obvious....
Smile

Thanks!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  ARB Multi textures NYGhost 2 2,493 Mar 19, 2003 01:52 PM
Last Post: NYGhost