title: OpenGL ES 2.0 - Fragment shader with multiple textures
body: <p>I'm setting up two textures as follow:</p>
  
  <pre><code>GLKTextureInfo  *texture = [GLKTextureLoader ...
  glActiveTexture(GL_TEXTURE0);
  glUniform1i(glGetUniformLocation(self.program, "uTextureMask"), 0);
  glBindTexture(GL_TEXTURE_2D, texture.name);
  
  texture = [GLKTextureLoader ...
  glActiveTexture(GL_TEXTURE1);
  glUniform1i(glGetUniformLocation(self.program, "uTextureLabel"), 1);
  glBindTexture(GL_TEXTURE_2D, texture.name);
  </code></pre>
  
  <p>referred in the fragment shader:</p>
  
  <pre><code>uniform sampler2D uTextureMask;
  uniform sampler2D uTextureLabel;
  </code></pre>
  
  <p>The problem is that only the last texture I bind is available in the shader.
  In the example above, only uTextureLabel works.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks,
  DAN</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>glGetUniformLocation returns 13 for uTextureMask and 14 for uTextureLabel.</p>
  
  <p>In the shader I do:</p>
  
  <pre><code>highp vec4 label = texture2D(uTextureLabel, vTexel);
  highp vec4 mask = texture2D(uTextureMask, vTexel);
  
  highp vec3 surface;
  
  surface = label.rgb;
  // surface = mask.rgb; // &lt;--- DOESN'T WORK    
  
  gl_FragColor = vec4(surface, 1.0);
  </code></pre>