October 2018
Intermediate to advanced
500 pages
12h 40m
English
The drawArrays and drawElements functions are used for writing to the framebuffer. drawArrays uses vertex data in the order in which it is defined in the buffer to create the geometry. In contrast, drawElements uses indices to access the vertex data buffers and create the geometry. Both drawArrays and drawElements will only use enabled arrays. These are the vertex buffer objects that are mapped to active vertex shader attributes.
In our example, the buffer that contains the vertex coordinates is the only enabled array. However, in a more general scenario, there may be several enabled arrays at our disposal.
For instance, we can have arrays with information about vertex colors, vertex normals, texture coordinates, and any ...