title: OpenGL multiple Sampler2D (array) examples?
body: <p>I find it surprisingly frustrating that it is so difficult to find examples of sampler2d arrays such as</p>
  
  <pre><code>uniform sampler2D myTextureSampler[5];
  </code></pre>
  
  <p>How would one store the uniform location of this?:</p>
  
  <pre><code>gl.GetUniformLocation(program, "myTextureSampler")
  </code></pre>
  
  <p>Would one simply use:</p>
  
  <pre><code>gl.GetUniformLocation(program, "myTextureSampler[0]")
  gl.GetUniformLocation(program2, "myTextureSampler[2]")
  </code></pre>
  
  <p>How would one go about using multiple textures like this:     </p>
  
  <pre><code>gl.BindTexture(gl.TEXTURE_2D, 1)
  gl.BindTexture(gl.TEXTURE_2D, 2)
  </code></pre>
  
  <p>etc..</p>
  
  <pre><code>gl.ActiveTexture(gl.TEXTURE0)
  gl.ActiveTexture(gl.TEXTURE1)
  </code></pre>
  
  <p>etc..</p>
  
  <p>Note: this code is not pure c++ opengl. Just looking for the basic concept on how it would be done. </p>
  
  <p>A simple example of passing, getting uniform location for a sampler2d array would be great. Does anyone have experience with this stuff?</p>