I have been reading:
http://alfonse.bitbucket.io/oldtut/Basics/Tut01%20Dissecting%20Display.html
I am not quite sure what this function does.
I think it enables the use of a given VBO, but I am not sure.
I thought that is what glEnableClientState(GL_VERTEX_ARRAY)
did.
Description. glEnableVertexAttribArray enables the generic vertex attribute array specified by index . glDisableVertexAttribArray disables the generic vertex attribute array specified by index . By default, all client-side capabilities are disabled, including all generic vertex attribute arrays.
A Vertex Array Object (VAO) is an OpenGL Object that stores all of the state needed to supply vertex data (with one minor exception noted below). It stores the format of the vertex data as well as the Buffer Objects (see below) providing the vertex data arrays.
A Vertex Array Object (or VAO) is an object that describes how the vertex attributes are stored in a Vertex Buffer Object (or VBO). This means that the VAO is not the actual object storing the vertex data, but the descriptor of the vertex data.
The Vertex Shader is the programmable Shader stage in the rendering pipeline that handles the processing of individual vertices. Vertex shaders are fed Vertex Attribute data, as specified from a vertex array object by a drawing command.
I have been reading: https://nicolbolas.github.io/oldtut/Basics/Tut01%20Dissecting%20Display.html
Then please read the next page; I explain exactly what it does there ;)
If I may quote myself:
We assigned the attribute index of the position attribute to 0 in the vertex shader, so the call to glEnableVertexAttribArray(0) enables the attribute index for the position attribute. ... If the attribute is not enabled, it will not be used during rendering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With