Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Is performance depending on VBOs count in VAO?

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2010
    Posts
    4

    Is performance depending on VBOs count in VAO?

    Hello,

    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.

    Best regards,

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256

    Re: Is performance depending on VBOs count in 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.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,787

    Re: Is performance depending on VBOs count in VAO?

    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.

  4. #4
    Junior Member Newbie
    Join Date
    Nov 2010
    Posts
    4

    Re: Is performance depending on VBOs count in VAO?

    Thanks guys for Your help. I see that I shouldn't use separate VBO for each vertex element when I need good performance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •