Associating Attributes to VBOs

Once we have created the VBOs, we need to associate these buffers to vertex shader attributes. Each vertex shader attribute will refer to one and only one buffer, depending on the correspondence that is established, as shown in the following diagram:

We can achieve this by following these steps:

  1. Bind a VBO
  2. Point an attribute to the currently-bound VBO
  3. Enable the attribute
  4. Unbind

Let's take a look at the first step.