Im interesting how to VAO works “under the hood”. In my code I need one glBindVertexArray before glDrawElements, but I don’t know how it bind call is expensive depending on VBOs count binded to my VAO. So it is important to performance how many VBOs I have binded to VAO? Without VAO I tried packed many vertex data to one VBO, but from design view separate VBO for each vertex element (position, normal, texcoord etc.) is more cool. How performace should look for this both aproches (each vertex element in separate VBO; all vertex elements in one VBO) when I will use VAO.
I don’t know how it works under the hood. OpenGL is implemented at the driver level by whoever is hired for X company (X = nvidia or AMD or Intel or etc).
VAO iteself is suppose to make our code cleaner and perhaps help with performance. It is suppose to reduce the “validation” steps that the driver does normally when you are not using VAO.
The performance impact depends on your application. If your bottleneck is elsewhere, then you won’t see a performance gain by using a single VBO for all attributes vs multi VBO.
A separate VBO for each element will always be slower, with or without VAO. GPUs like to recieve all elements of a vertex in a single chunk, and interleaving them in this way will give you better performance. There are papers on the internet that claim otherwise, but these date from before the age of hardware T&L when there were advantages to splitting out at least position.
Thanks guys for Your help. I see that I shouldn’t use separate VBO for each vertex element when I need good performance.