   Opengl + Shader + Multitexture problem
  Hello guys!I'm trying to apply a texture to a cube in opengl with c++ using a shader to mix textures...I enable the gl_multitexture_arband set the texture as gl_texture0_arb, gl_texture1_arbbut when I take it in a vertex shader as  gl_TexCoord[0] = gl_MultiTexCoord0;  gl_TexCoord[1] = gl_MultiTexCoord1;the first in fragment is totaly black!!! why???HELP ME PLZ!!!   
  Might wanna move this to OpenGL forum... but post your code that creates your texture, if you dont set it right then sometimes that happens...   ;  Are you trying to read 2 textures, mix them or something with the fragment shader, and output to 1 texture that is applied to the cube? I'd need to see your vertex and fragment shader code, and texture setup/binding when you draw the cube.   ;  So, I want to try this example http://www.lighthouse3d.com/opengl/glsl/index.php?textureMultihere is my codes...FRAGMENT:varying vec3 lightDir,normal;uniform sampler2D tex,l3d;void main(){vec3 ct,cf;vec4 texel;float intensity,at,af; intensity = max(dot(lightDir,normalize(normal)),0.0); cf = intensity * (gl_FrontMaterial.diffuse).rgb +   gl_FrontMaterial.ambient.rgb;af = gl_FrontMaterial.diffuse.a; texel = texture2D(tex,gl_TexCoord[0].st)+  texture2D(l3d,gl_TexCoord[1].st);ct = texel.rgb;at = texel.a; gl_FragColor = vec4(ct * cf, at * af);}VERTEX:varying vec3 lightDir,normal;void main(){normal = normalize(gl_NormalMatrix * gl_Normal);lightDir = normalize(vec3(gl_LightSource[0].position)); gl_TexCoord[0] = gl_MultiTexCoord0;gl_TexCoord[1] = gl_MultiTexCoord1;gl_Position = ftransform();}ROUTINE THAT CREATE FACE OF CUBE:    glPushMatrix();    if(tt_state) tt.select();glBegin(GL_POLYGON);    int i;    vector N = normale(p[0], p[1], p[2]);    glNormal3f(N.x, N.y, N.z);   for(i = 0; i < n_lati; i++){if(c_state) glColor3f(c.r, c.g, c.b);if(!tt_state) glMultiTexCoord2fARB(GL_TEXTURE0_ARB, tc.x, tc.y);if(!tt_state) glMultiTexCoord2fARB(GL_TEXTURE1_ARB, tc.x, tc.y);if(tt_state) glTexCoord2f(tc.x, tc.y);  glVertex3f(p.x, p.y, p.z);   }glEnd();    glPopMatrix();tt_state allow to choose the type of textcoord...these are the coord of vertex and tcoord    vertice(0, 10, 10, 10);    vertice(1,-10, 10, 10);    vertice(2,-10, -10, 10);    vertice(3,10, -10, 10);    tcoord(0, 1, 0);    tcoord(1, 1, 1);    tcoord(2, 0, 1);    tcoord(3, 0, 0);    vertice(0,10, 10, -10);    vertice(1,-10, 10, -10);    vertice(2,-10, -10, -10);    vertice(3,10, -10, -10);    tcoord(0, 1, 0);    tcoord(1, 1, 1);    tcoord(2, 0, 1);    tcoord(3, 0, 0);    vertice(0,10, 10, 10);    vertice(1,10, -10, 10);    vertice(2,10, -10, -10);    vertice(3,10, 10, -10);    tcoord(0, 1, 0);    tcoord(1, 1, 1);    tcoord(2, 0, 1);    tcoord(3, 0, 0);    vertice(0,-10, -10, 10);    vertice(1,-10, -10, -10);    vertice(2,10, -10, -10);    vertice(3,10, -10, 10);    tcoord(0, 1, 0);    tcoord(1, 1, 1);    tcoord(2, 0, 1);    tcoord(3, 0, 0);    vertice(0,-10, 10, 10);    vertice(1,10, 10, 10);    vertice(2,10, 10, -10);    vertice(3,-10, 10, -10);    tcoord(0, 1, 0);    tcoord(1, 1, 1);    tcoord(2, 0, 1);    tcoord(3, 0, 0);    vertice(0,-10, 10, -10);    vertice(1,-10, -10, -10);    vertice(2,-10, -10, 10);    vertice(3,-10, 10, 10);    tcoord(0, 1, 0);    tcoord(1, 1, 1);    tcoord(2, 0, 1);    tcoord(3, 0, 0);MULTITEXTURE:    glActiveTextureARB(GL_TEXTURE0_ARB);    glEnable (GL_TEXTURE_2D);    n.bind();    //Texture dettagli...    glActiveTextureARB(GL_TEXTURE1_ARB);    glEnable (GL_TEXTURE_2D);    d.bind();That's all...;  You have to tell to glsl that the sampler2D "tex" correspond to the texture unit 0, and "l3d" correspond to the texture unit 1 like this :glUniform1i( glGetUniformLocation(shader, "tex"), 0);glUniform1i( glGetUniformLocation(shader, "l3d"), 1);;  Oh my GOD perfect, works!!!I have tried before to tell to shader this but I have used glGetUniformLocationARBSo thx a lot!!!! :D   