Q:

How can I read from multiple textures in an OpenGL ES 2 shader?

How can I enable more than one texture in OpenGL ES 2 so that I can sample from all of them in my shader? For example, I'm trying to read from two different textures in my shader for the player's car.
This is how I'm currently dealing with the texture for my car:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, this->texture2DObj);
glUniform1i(1, 0);
glBindBuffer(GL_ARRAY_BUFFER, this->vertexBuffer);
glEnableVertexAttribArray(0);

int offset = 0;
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, this->vertexBufferSize,(const void *)offset);

offset += 3 * sizeof(GLfloat);
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, this->vertexBufferSize, (const void*)offset);

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, this->indexBuffer);
glDrawElements(GL_TRIANGLES, this->indexBufferSize, GL_UNSIGNED_SHORT, 0);
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);

A:

In brief, you want code like this:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, this->texture2DObj);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, this->otherTexture2DObj);
GLint samplerArrayLoc = glGetUniformLocation(shaderObject, "texture");
const GLint samplers[2] = {0,1}; // we've bound our textures in textures 0 and 1.
glUniform1iv( samplerArrayLoc, 2, samplers );

You bind your textures into two different texture slots (in this case, GL_TEXTURE0 and GL_TEXTURE1), then set your shader uniforms to tell the shader which texture slots to use for their texture lookups.  
In this code, I assume that your shader will receive these samplers as uniform sampler2D texture[2];  You may alternately have them as separate uniform variables rather than a single uniform array, in which case you'd set their values separately, instead of in a single call.
Then your shader can just read from either texture[0] or texture[1] to sample from either of the two textures.
And that's pretty much all there is to it!

