Original Post
I'm having difficulties with multi-texturing in GLSL. I have binded my textures in the usual way (glActiveTexture, glBindTexture, glEnable(GL_TEXTURE_2D) ) and multi-texturing works for the fixed function pipeline. When I switch to using a shader object, multi-texturing doesn't work! This leads me to believe that either: 1. My GLSL code is incorrect 2. There is something that I haven't done (an OpenGL function I haven't called maybe?) before the geometry is rendered Attached below is a simple fragment shader that should use the first set of texture coordinates to sample the 2D texture binded to GL_TEXTURE1:
uniform sampler2D sampler0, sampler1;
void main ( void )
{
gl_FragColor = texture2D ( sampler1, gl_TexCoord[0] );
} What actually happens is no matter which sampler I use for the first argument of 'texture2D', it always samples the 2D texture bound to GL_TEXTURE0. I am definitely binding my textures correctly, as fixed-function works fine. Any help would be much appreciated! Thanks, birdjames.