title: GLSL 1.5 & OpenGL 3.3: Passing color to vertex shader seems to fail
body: <p>I have a problem when passing vertex attributes to the running shader program. I'd like to pass two attributes, the position and a RGBA-color. Binding the attribute location works for the position. However, it does not work for the color. Therefore, all the geometry is eventually rendered black.</p>
  
  <p>This is what I do:</p>
  
  <pre><code>GLuint programHandler;
  
  // create program
  // compile &amp; attach vertex shader
  // compile &amp; attach fragment shader
  
  glBindAttribLocation(programHandler, 0, "InPosition");
  glBindAttribLocation(programHandler, 1, "InColor");
  glBindFragDataLocation(programHandler, 1, "FragColor");
  
  glLinkProgram(programHandler);
  glUseProgram(programHandler);
  
  // initialize uniform variables
  
  // I'm trying to get the attribute locations now.
  // I expect location "0" for InPosition and location "1" for InColor.
  // In fact, it gets me a "-1" for InColor. I simply cannot see the reason for that behaviour
  
  GLint positionLocation = glGetAttribLocation(programHandler, "InPosition"); // returns 0
  GLint colorLocation = glGetAttribLocation(programHandler, "InColor"); // returns -1
  
  glEnableVertexAttribArray(positionLocation);
  glEnableVertexAttribArray(colorLocation); // fails!
  </code></pre>
  
  <p>My vertex shader is very basic. All I really do is transforming vertices and passing the color to the fragment shader:</p>
  
  <pre><code>#version 150 core
  
  // input
  uniform mat4 ModelviewMatrix;
  uniform mat4 ProjectionMatrix;
  in vec3 InPosition;
  in vec4 InColor;
  
  // output
  out vec4 PassColor;
  
  void main(void) {
      // passing color through to fragment shader
      PassColor = InColor;
  
      // transformation
      gl_Position = ProjectionMatrix * ModelviewMatrix * vec4(InPosition, 1.0);
  }
  </code></pre>
  
  <p>My fragment shader should simply return that color:</p>
  
  <pre><code>#version 150 core
  precision highp float;
  
  // input
  in vec4 PassColor;
  
  // output
  out vec4 FragColor;
  
  void main(void) {
      FragColor = PassColor;
  }
  </code></pre>
  
  <p>Why does binding "InPosition" work and "InColor" does not? I am aware that the GLSL compiler optimizes the shader code, so that unused variables cannot be bound. But, I don't see why the color should be optimized out here. After all, I use it by passing it to the fragment shader.</p>