So we have vertices that map to points, and these points are slaves to the primitive.
Order of vertices don’t really matter. (pos1, pos2, pos3) or (pos2, pos3, pos1), or (pos1, pos3, pos2) or any other position order doesn’t affect the fact that it’ll always just end up a triangle.
But when you have multiple triangles, and when a triangle has a side that is also the side of another triangle (think of conjoined twins), you got a problem.
(pos1, pos2, pos3), (pos2, pos3, pos5).
You used pos3 and pos2 twice.
What’s the solution?
(pos1, pos2, pos3)
(0,1,2).
That’s right, we’ve decoupled the indices.
Swap the indices around, and you swap how the vertices are ordered, without actually ordering the vertexes.
(deleted a whole paragraph thoroughly explaining EBOs cause words >2000..)
They’re much simpler than you think though, im just a yapper)
Vertex attributes. They basically give us position, color, and whatnot. They’re ‘attributes’ in a literal sense.
You have a VBO (vertex buffer object), which just aggregates vertices for optimization and quality of life. They’re nothing more than that. (at least I believe)
Then you have a VAO (vertex ARRAY object), which aggregates vertex attributes for quality of life. It’d be a hassle to set up vertex attributes for each and every single vertex in a vertex buffer, right?
You also have shaders, like vertex shaders and fragment shaders. These are like components of the graphics pipeline that take your (pos1, pos2, pos3) vertex data, and do stuff with it. For example, vertex shaders take the (pos1, pos2, pos3) and output a new thing (i forgot what the thing was), or fragment shaders that take primitives and give them a color.
You then have a shader program, which just attaches all these shaders above (vertex and fragment shaders in this case), and links them together. In the render loop, you run a function that ‘uses’ the shader program (literally called glUseProgram()).
Log in to leave a comment