🔒 Locked
Vertex Array Objects... good or bad?
Advertisement
Original Post
I'll admit, I was suckered into this sexy honeypot trap when I saw the one call to bind a single VAO and then draw it, instead of binding VBO after VBO after VBO and then draw. Is it truly not worth the energy?
It's not a question of 'if' it's a question of 'when' you will be forced to use VBO's. Remember: there's no such thing as a VAO in OpenGL 4.x/ES 2.x. Why not do the right thing and use VBOs everywhere ?
I think that there is no case were using VAOs isn't useful, it might not speed up your calculations a lot,
but makes managing all the different meshes you want to render a lot easier.
@[color="#1D3652"][size="4"]ileonte
i think you mixed up Vertex Arrays with Vertex Array Objects. Also i think that we shouldn't use the name VBO anymore cause there is no such thing as Vertex Buffer Objects anymore.
We have simple Buffer Objects which can be used for a lot of different stuff (Uniform block, Texture and of course Vertex Data).
but makes managing all the different meshes you want to render a lot easier.
@[color="#1D3652"][size="4"]ileonte
i think you mixed up Vertex Arrays with Vertex Array Objects. Also i think that we shouldn't use the name VBO anymore cause there is no such thing as Vertex Buffer Objects anymore.
We have simple Buffer Objects which can be used for a lot of different stuff (Uniform block, Texture and of course Vertex Data).
It's not a question of 'if' it's a question of 'when' you will be forced to use VBO's. Remember: there's no such thing as a VAO in OpenGL 4.x/ES 2.x. Why not do the right thing and use VBOs everywhere ?
Hmm....
OpenGL ES 2.x OES approved VAO Extension
OpenGL 4.1 Core Spec (pp. 52, Vertex Array Objects)
[font="arial, verdana, tahoma, sans-serif"]I was under the impression that vertex array OBJECTS are client-side objects defined using glVertexPointer(), glNormalPointer(), glTexCoordPointer() in conjunction with glEnableClientState( GL_VERTEX_POINTER / GL_NOMRAL_POINTER / GL_TEXTURE_COORD_POINTER ) which have all been removed (or at least marked as deprecated) in OpenGL 3.0+/OpenGL ES 2.0+. I was wrong and I'm sorry for spreading misinformation.[/font]
[font="Book Antiqua"]Before this week, my engine had IBOs and VBOs (element arrays and vertex arrays in buffer objects), but no VAOs (vertext array objects). I would have added them months ago, but every description massively confused me. Finally I read, and read, and re-read the description in the latest version of the OpenGL SuperBible and finally... "figured them out".
I then added one VAO for each IBO/VBO pair and changed my code accordingly.
Result: It made my code lots simpler! It would also speed up my code except I have huge batches, so the overhead of setting up the vertex attributes before every call of[font="Courier New"] glDrawElements() [/font]wasn't very much in my case. But my case is unusual (huge batches), so you may well realize a significant speed increase as well as much cleaner code.
Now that I understand VAOs, they're a "no brainer".[/font]
I then added one VAO for each IBO/VBO pair and changed my code accordingly.
Result: It made my code lots simpler! It would also speed up my code except I have huge batches, so the overhead of setting up the vertex attributes before every call of[font="Courier New"] glDrawElements() [/font]wasn't very much in my case. But my case is unusual (huge batches), so you may well realize a significant speed increase as well as much cleaner code.
Now that I understand VAOs, they're a "no brainer".[/font]
Vertex Array Objects have problems on OpenGL ES prior to version 3: http://blog.linderdaum.com/?p=15
One thing is the vendors actually supporting what they're saying they support and another different thing is the spec stating what should be supported.
* Should vertex array objects be sharable across multiple OpenGL ESHeh.contexts?
RESOLVED: No. The OpenGL ES working group took a straw-poll and
agreed that compatibility with OpenGL and ease of implementation
were more important than creating the first non-shared named object
in OpenGL ES.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement