Results 1 to 4 of 4

Thread: Binding multiple VBOs in one call

  1. #1
    Member Newbie
    Join Date
    Nov 2003
    Location
    NSW
    Posts
    33

    Binding multiple VBOs in one call

    Hi there,

    I have about 400 VBOs - half contain colour data and the other half contain vertex data. When it comes to drawing this using glDrawArrays, my frame rate is reduced to about 40fps. If I eliminate the glDrawArrays call then my frame rate is back up to 60fps. Thus I think that I have a problem given the number of times glDrawArrays gets called (200 * 60 frames per second = 12,000 times per second).

    I'm thinking that an obvious thing would be to consolidate the VBOs into just two i.e. one for colour data and the other for the vertex data. I could then use glMultiDrawArrays to pick out the multiple offsets and counts to draw from those 2 VBOs. However my present individual VBOs come and go (they represent flight paths) so I'd have to cater for this with the new VBO strategy.

    Ideally, given the way my data is structured, it would be great to do something like this:

    GLuint vertexBuffers[200];
    glGenBuffers(1, &vertexBuffers[0]);

    ...
    glBindBuffers(GL_ARRAY_BUFFER, vertexBuffers);
    // (note the intended glBindBuffers as opposed to glBindBuffer).

    ...
    glMultiDrawArrays(...)

    i.e. have a means of binding multiple buffers through re-direction.

    Is this somehow possible or will I need to re-structure things to use the two VBOs mentioned? Thanks for any help.

    Cheers,
    -C

  2. #2
    V-man
    Guest

    Re: Binding multiple VBOs in one call

    There is no glBindBuffers.
    400 VBOs is a lot. I'm sure your VBO's are 100KB. Make some 2 or 4MB VBOs.
    Use glDrawRangeElements if possible. Put the indices in a index BO.

    Put the color and vertex in the same VBO.
    struct vertex
    {
    float x, y, z
    DWORD color;
    float padding[4];
    }

    padding is for making it a multiple of 32 bytes.

  3. #3
    Member Newbie
    Join Date
    Nov 2003
    Location
    NSW
    Posts
    33

    Re: Binding multiple VBOs in one call

    Thanks for your reply. I've now bitten the bullet and allocate/manage a couple of larger VBOs and then use glMultiDrawArrays. I'm now getting the framerate that I seek.

    AFAIK there's no performance advantage to combining my colour and vertex VBOs is there? I maintain them separately as they are updated at different rates with the vertex one possibly never changing.

  4. #4
    V-man
    Guest

    Re: Binding multiple VBOs in one call

    If it's necessary to keep them separate, like if you want to modify color and keep vertex static, then it should be ok to keep them separate.

Similar Threads

  1. VAO & binding multiple VBOS
    By Dariusz in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-19-2019, 11:51 AM
  2. Replies: 9
    Last Post: 11-02-2018, 08:16 AM
  3. Binding Multiple VBOs and EBOs to VAO?
    By sylorr in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-13-2018, 08:56 PM
  4. Multiple objects in a VBO or Multiple VBOs?
    By Kreed in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 09-04-2012, 12:42 PM
  5. VBOs and binding multiple times
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-18-2004, 03:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean