Results 1 to 4 of 4

Thread: VBO Question: How many buffers?

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2007
    Posts
    21

    VBO Question: How many buffers?

    I've got some vertex position data and color data. Both of these are stored as textures in an FBO (one texture for position and one texture for color). I'm using the FBO->PBO->VBO technique for render-to-vertex-array.

    The question is, since I've got both position data and color data, do I need one VBO or two? In other words, do I need separate VBOs for position and color? Or do I need one single VBO with the positon data followed by the color data?

    I've seen it both ways, but I can't find anything that says if one way is significantly better or faster.

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2007
    Posts
    21

    Re: VBO Question: How many buffers?

    Doh, I didn't realize there were multiple pages of search results for the search I did on this forum. I'm still reading through them, but will post them here as I find them:
    Topic: Problem with VBOs
    Originally posted by Relic:
    While storing the data interleaved in a single buffer is a good idea, it's wrong that you must put all the data in one array buffer. Unfortunately the spec has no nice example but it's possible to put each attribute into a separate vertex buffer object. That's nice if you have some static and some dynamic data. Group them into separate buffer objects.

    The BindBuffer call just select a buffer, only the gl*Pointer calls associate buffers with attributes. It looks like this:

    BindBufferARB(ARRAY_BUFFER_ARB, 1);
    VertexPointer(4, FLOAT, 0, BUFFER_OFFSET(0));
    BindBufferARB(ARRAY_BUFFER_ARB, 2);
    ColorPointer(4, UNSIGNED_BYTE, 0, BUFFER_OFFSET(0));
    However, while this confirms that you can use either one or two buffers, it doesn't really say which way is better. Will keep looking...
    _______________________________________________

    Correct VBO Usage?
    Originally posted by arekkusu:
    I've only experimented with VBO's briefly, but from my understanding of the spec, creating separate buffers per attribute is perfectly valid. However you only want to do this in the case where you know that some attributes are static and some are dynamic, i.e. caching texture coords in VRAM while streaming positions and normals. If you've marked everything dynamic you're probably better off with one large buffer.
    This one says that one is better, but it doesn't really say why.

  3. #3
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: VBO Question: How many buffers?

    Both approaches should provide the same performance. Of course, this may vary from card to card and from driver to driver but you can't do anything about it.
    You should use the one you feel more comfortable with.

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2007
    Posts
    21

    Re: VBO Question: How many buffers?

    Thanks for your reply. In that case, I'll just go ahead and use two separate buffers, since I've got it working that way already.

Similar Threads

  1. Texture buffers are much slower than uniform buffers
    By glnoob in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 11-14-2018, 02:00 PM
  2. Replies: 3
    Last Post: 05-23-2016, 07:41 PM
  3. front buffers, back buffers & wglMakeCurrent
    By mark ds in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-22-2010, 05:15 AM
  4. Question about index-buffers
    By Jan in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 01-21-2004, 03:50 PM
  5. Vertex Buffers and render/texture Buffers
    By schelter in forum OpenGL: General
    Replies: 4
    Last Post: 02-03-2002, 08:00 PM

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