title: Pass colors and positions to shader from separate VBO
body: <p>I am trying to draw <code>VAO</code> from separate <code>VBO</code>. My goal is to get different colors for each vertex of my geometry. But with my code it still all red. </p>
  
  <p>I think my error is this code fragment. Please, help me to find it. (I have skipped program and matrices set ups)</p>
  
  <p><strong>Set up</strong></p>
  
  <pre><code>            vao = new int[1];
              buffers = new int[2];
  
              GL.GenVertexArrays(1, vao);
              GL.GenBuffers(2, buffers);
  
              GL.BindVertexArray(vao[0]);
              GL.EnableVertexAttribArray(0);
  
              GL.BindBuffer(BufferTarget.ArrayBuffer, buffers[0]);
  
              unsafe
              {
                  fixed (void* verts = quad_strip3)
                  {
                      var prt = new IntPtr(verts);
  
                      GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(quad_strip3.Length * sizeof(float)), prt,
                          BufferUsageHint.StaticDraw);
  
                  }
              }
  
              GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, 0, new IntPtr(0));
  
  
              GL.BindBuffer(BufferTarget.ArrayBuffer, buffers[1]);
  
              var r = new Random();
  
              var colors = new float[quad_strip3.Length];
  
              for (int i = 0; i &lt; colors.Length; i++)
              {
                  colors[i] = (float)r.NextDouble();
              }
  
  
              unsafe
              {
                  fixed (void* verts = colors)
                  {
                      var prt = new IntPtr(verts);
  
                      GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(colors.Length * sizeof(float)), prt,
                          BufferUsageHint.StaticDraw);
  
                  }
              }
  
              GL.VertexAttribPointer(1, 3, VertexAttribPointerType.Float, false, 0, new IntPtr(0));
  </code></pre>
  
  <p><strong>Draw code</strong></p>
  
  <pre><code>    GL.BindVertexArray(vao[0]);
      GL.DrawArrays(PrimitiveType.QuadStrip, 0, 26);
  </code></pre>
  
  <p><strong>Vertex shader</strong></p>
  
  <pre><code>#version 150 core
  
  in vec3 in_Position;
  in vec3 in_color;
  out vec3 pass_Color;
  uniform mat4 projectionMatrix;
  uniform mat4 viewMatrix;
  uniform mat4 modelMatrix;
  
  void main(void) {
      gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_Position, 1.0);
      pass_Color = in_color;
  }
  </code></pre>
  
  <p><strong>Fragment shader</strong></p>
  
  <pre><code>#version 150 core
  in vec3 pass_Color;
  out vec4 out_Color;
  
  void main(void) {
      out_Color = vec4(pass_Color, 1.0);
  }
  </code></pre>