Satchmo Brown
Satchmo Brown

Reputation: 1437

OpenGL - glVertexAttribPointer with multiple VBOs and VAOs using the same shader

I have multiple VBOs and matching VAOs set up in my rendering engine. I am a bit confused about using glVertexAttribPointer. I have set it and it renders fine but I am curious if I am using one shader (a basic diffuse) with all of these different objects, do I set glVertexAttribPointer each time I create a VAO. I guess what's throwing me is I am trying to figure out if my setting an attribute pointer, is that set in the shader or the vertex array object. I assume it's the vertex array object but am hoping for some clarification.

Upvotes: 0

Views: 940

Answers (1)

radical7
radical7

Reputation: 9114

Vertex attribute pointers are per vertex array object (VAO). The OpenGL 4.3 specification on page 318 in the description of glGetVertexAttribPointerv specifies: The value returned is queried from the currently bound vertex array object.

Upvotes: 2

Related Questions