What exactly does glEnableVertexAttribArray do?

I have been reading: Dissecting Display, Chapter 1. Hello, Triangle!.

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.


It's similar to a vertex array but stores additional extra values for each point rather than it's coordinates. You might want to store a temperature, density, signal strength at each point in a modelling app for example, or perhaps a damage value for a game

Tags:

Opengl