title: OpenGL shader not passing correct texture coordinates
body: <p>After testing a few things in my OpenGL application, I know that my textures are not loading correctly because the texture coordinates are failing to get from the vertex shader to the fragment shader (or atleast they are all passed as (0,0). I just don't know why.</p>
  
  <p>Here are my positions, indices and texture coordinates for a square:</p>
  
  <pre><code>private static final float[] VERTICES = {
      -0.5f,  0.5f, 0f,
      -0.5f, -0.5f, 0,
       0.5f, -0.5f, 0f,
       0.5f,  0.5f, 0f
  };
  
  private static final int[] INDICES = {
      0, 1, 2,
      3, 0, 2
  };
  
  private static final float[] TEXTURE_COORDINATES = {
      0.0f, 0.0f,
      0.0f, 1.0f,
      1.0f, 1.0f,
      1.0f, 0.0f
  };
  </code></pre>
  
  <p>Here is how I insert the texture coordinates into the vao at index 1. For the sake of brevity I won't show the other parts of my vao loader since they are in working order.</p>
  
  <pre><code>int vboTexCoordID = GL15.glGenBuffers();
  ModelManager.recordVBO(vboTexCoordID);
  GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vboTexCoordID);
  
  FloatBuffer texCoordBuffer = BufferUtils.createFloatBuffer(texCoord.length);
  verticesBuffer.put(texCoord);
  verticesBuffer.flip();
  
  GL15.glBufferData(GL15.GL_ARRAY_BUFFER, texCoordBuffer, GL15.GL_STATIC_DRAW);
  GL20.glVertexAttribPointer(1,2,GL11.GL_FLOAT, false,  0,0);
  GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
  </code></pre>
  
  <p>This is my render method:</p>
  
  <pre><code>    model.getShader().start(); // this calls GL20.glUseProgram()
      GL30.glBindVertexArray(model.getVaoID());
      GL20.glEnableVertexAttribArray(0);
      GL20.glEnableVertexAttribArray(1);
      GL13.glActiveTexture(GL13.GL_TEXTURE0);
      GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexId());
      GL11.glDrawElements(GL11.GL_TRIANGLES, model.getVerticesCount(), GL11.GL_UNSIGNED_INT,0);
      GL20.glDisableVertexAttribArray(0);
      GL20.glDisableVertexAttribArray(1);
      GL30.glBindVertexArray(0);
      model.getShader().stop();
  </code></pre>
  
  <p>and finally mt vertex shader and fragment shader in that order:</p>
  
  <pre><code>#version 330 core
  
  in vec3 position;
  in vec2 texCoords;
  
  out vec2 pass_texCoords;
  
  void main(void){
  
      gl_Position = vec4(position.x, position.y, position.z, 1.0);
      pass_texCoords = texCoords;
  
  }
  </code></pre>
  
  <p>fragment:</p>
  
  <pre><code>#version 330 core
  
  in vec2 pass_texCoords;
  
  out vec4 out_Color;
  
  uniform sampler2D textureSampler;
  
  void main(void){
  
      out_Color = texture(textureSampler, pass_texCoords);
  
  }
  </code></pre>