What to use when, and why? That's what I want to know.
And can someone explain to what VAO are exactly (in terms of application) in layman's terms?
Thank you. :pwn::pwn:
[QUOTE=Cockman;37130240]What to use when, and why? That's what I want to know.[/QUOTE]Uniforms are values that you set once and they stay the same for all vertices. Vertex Attributes are on a per-vertex basis and are included in the vertex data, so each vertex can have its own different value.
So why would I ever want a set of vertices with the same value? Wouldn't they all be at the same place? Like a dot?
Vertex attributes allow different values, while uniform values are strictly identical??
And what are Vertex Array Objects, what is their purpose?
[QUOTE=Cockman;37137892]So why would I ever want a set of vertices with the same value? Wouldn't they all be at the same place? Like a dot?[/QUOTE]
Common uniforms of vertices are a MVP matrix, a color, and a texture; while common vertex attributes are positions, normals, and colors.
[QUOTE=Cockman;37137892]Vertex attributes allow different values, while uniform values are strictly identical??[/QUOTE]
Yes, uniforms are required to stay uniform during the whole draw call. They can be changed while not drawing. Normally uniforms only include information about the whole group of vertices being drawn.
Vertex attributes are only useful if you need specific data for each vertex.
[QUOTE=Cockman;37137892]And what are Vertex Array Objects, what is their purpose?[/QUOTE]
Unfortunately I don't know this because I've never used them before.
[QUOTE=Cockman;37137892]And what are Vertex Array Objects, what is their purpose?[/QUOTE]
Vertex Array Objects store the link between raw vertex data in buffers and vertex shader inputs, they allow you to easily switch between states related to drawing calls and their use is mandatory in forward-compatible OpenGL.
[QUOTE=Overv;37140815]Vertex Array Objects store the link between raw vertex data in buffers and vertex shader inputs, they allow you to easily switch between states related to drawing calls and their use is mandatory in forward-compatible OpenGL.[/QUOTE]
In your open.gl tutorial, I analyzed your code (c2_triangle) for the display example involving a vertex array objects. You didn't really seem to do anything with other than generate it, bind it, and delete it.
That's because binding a vertex buffer sets it to the currently bound vertex array object. Setting vertex attributes also affect the bound buffer and vertex array object. If you didn't know that it works this way, it's not clear from that example.
This might help
[URL]http://www.opengl.org/wiki/Vertex_Array_Object[/URL]
Sorry, you need to Log In to post a reply to this thread.