   GLSL passing multiple textures to shader
  Hello, I'm trying to pass three textures to my shader program. I wonder if i'm really passing all three different textures or just 1. This is an old proyect (well 1 year)  and I can't remember right now all the details but it was something like this:First I render to texture some stuff to create 3 different texture objects (assume the render method renders to float texture using pbuffers, it uses glGenTextures to create the texture object and this works fine)m_GI = new GeometryImage();glActiveTexture(GL_TEXTURE0);glEnable(GL_TEXTURE_2D);m_GI->Render();m_BVH = new BoundingVolumeHierarchy();glActiveTexture(GL_TEXTURE1);glEnable(GL_TEXTURE_2D);m_BVH->Render();m_LH = new LinkHierarchy();glActiveTexture(GL_TEXTURE2);glEnable(GL_TEXTURE_2D);m_LH->Render();I'm not 100% sure, but I remember my latest test told me that the texture ID's were fine (i.e. 1,2,3 or consecutive numbers). Then, I draw the scene://get the uniform location of each texture using glGetUniformLocationARB//then set the uniform variable using glUniform1iARB//in my code looks like this, where m_GI is the ID of the GI texture, etc.m_Shader->SetUniform(m_GIUniformLoc, m_GI);m_Shader->SetUniform(m_BVHUniformLoc, m_BVH);m_Shader->SetUniform(m_LHUniformLoc, m_LH);//render the scene (pseudo code)for(each mesh)  mesh->render();Finally, the fragment programuniform sampler2D GI;uniform sampler2D LH;uniform sampler2D BVH;...var = texture2D(BVH, coords).xyz;...So I wonder if this code works to pass 3 different textures to the shader program, or am I just passing the last texture? or the first?The problem is that I cannot tell right now if after the call to "new" i'm really getting consecutive numbers for the texture ID's ... uhmmAny thoughts?   
  To pass multiple textures to a shader, bind each texture to a texture unit using glActiveTexture, then glBindTexture, and pass the texture unit number (0, 1, 2, ..., etc) to the uniform sampler.   ;  My latest Dev Journal entry has exactly how to do this. Check it out, hope it answers some questions.   ;  Thanks Andy & Huntsman, I think that's exactly what i'm doing (except that I use glActiveTexture instead of glActiveTextureARB, don't know if that's makes a difference).Anyway I need to recompile my program and check again this stuff.   