I need help to see the trade-offs between them.
- It looks to me that
glDrawElements()
needs to get the index-data "live" as a parameter. - On the other side if I use VAOs then during startup I buffer the data and the driver might decide to put it on the GPU, then during rendering I only bind the VAO and call
glDrawArrays()
.
Is there no way to combine the advantages? Can we buffer the index-data too?
And how would that look in the vertex shader? Can it use the index and look it up in the vertex positions array?