- Real-Time 3D Graphics with WebGL 2
- Farhad Ghayour Diego Cantor
- 77字
- 2021-06-10 19:42:55
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:
- Bind a VBO
- Point an attribute to the currently-bound VBO
- Enable the attribute
- Unbind
Let's take a look at the first step.