Newcomer to OpenGL, I have the following question:
From what I have gathered, vertex order in a VBO is maintained in drawing, so drawing a VBO with 3 vertex triplets will draw the first triangle (=the first 3 vertices in the VBO) first, the second second and the third last. The hardware might cheat a bit internally, but the end result should appear in the screen as if it really happened in this way.
My question is this: Suppose I have several textured quads with transparency (the kind that needs sorting before drawing). If I enter the relevant vertex data in the VBO according to each quads’ depth, that is, if I create the VBO in such a manner that the vertex and thus the quad data is already “sorted” according to which I want to be drawn first, second etc., does this also guarantee that the transparent quads will be drawn correctly when I bind the VBO to the VAO and draw?
While it is trivial to write a short example and see for myself, even if the quads appear correctly on my system, I have no idea if it’s just my system and not everyone else’s, so I thought I’d ask here.
Thanks in advance!
EDIT: To clarify, this is for a 2D project with sprite rendering, in case it makes any difference.