Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: GL_ARB_vertex_array_object2

  1. #1
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    935

    GL_ARB_vertex_array_object2

    Hi,

    I thinking VAO could bit a lot better and allow fast buffer object switch.

    From:
    Code :
    for(std::size_t i = 0; i < positionArrayName.size(); ++i)
    {
      glBindVertexArray(positionArrayName[i]);
      glDrawArrays(GL_TRIANGLES, 0, VertexCount);
    }
    glBindVertexArray(0);

    To:
    Code :
    glBindVertexArray(positionArrayName);
    for(std::size_t i = 0; i < positionBufferName.size(); ++i)
    {
      glActiveArray(GL_ARRAY0);
      glBindBuffer(positionBufferName[i]);
      glDrawArrays(GL_TRIANGLES, 0, VertexCount);
    }
    glBindVertexArray(0);

    Or hopefully something more clever. I know how this "glActive***" idea becomes an issue for texture ... even ifthe real issue is the mix of image and filter in a single object.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,576

    Re: GL_ARB_vertex_array_object2

    allow fast buffer object switch.
    No such thing. So there's no point in allowing it.

  3. #3
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    935

    Re: GL_ARB_vertex_array_object2

    Why there is no point?

    Let's me picture you the use of it.

    Let's say we have a scene with 10 different meshes. Each object have position, texcoord and normals but different geometry.

    This could allow to create a single VAO and just change the buffer(s) used for each meshes.

    10 descriptions of how the buffer are use seams pointless to me, duplicate.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,386

    Re: GL_ARB_vertex_array_object2

    If you mean factoring the format into a separate object like dx10 does, that may not be strictly necessary for good performance. Probably the best overall usage is to minimize the number of objects you create and to avoid switching them, pretty much the way you'd deal with any other state...

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,576

    Re: GL_ARB_vertex_array_object2

    Let's say we have a scene with 10 different meshes. Each object have position, texcoord and normals but different geometry.

    This could allow to create a single VAO and just change the buffer(s) used for each meshes.
    Or you could have 10 VAOs. The latter is the one that is guaranteed to be the fastest, and VAO is all about performance.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: GL_ARB_vertex_array_object2

    Isn't the whole point of VAOs _NOT_ to change any state after setting it up once? So, they should give you the best performance (of buffer switching) exactly when you DO have the 10 duplicates, INSTEAD of changing their state.

    Or did i miss anything here? I haven't used that extension yet, but from what i read, i thought that would be the supposed usage.

    Jan.
    GLIM - Immediate Mode Emulation for GL3

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,386

    Re: GL_ARB_vertex_array_object2

    You haven't missed anything, unless I've missed something.

  8. #8
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    935

    Re: GL_ARB_vertex_array_object2

    Yes that's the issue. Why creating pack of states and changing the pack of states when there are actually the same?

    If the purpose is not to change states so share them to multiple buffers.

    These VAOs are what I was expecting from the Long Peak format object, describ how to use array buffers and I guest this could lead to an extract benefit.

  9. #9
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,576

    Re: GL_ARB_vertex_array_object2

    Why creating pack of states and changing the pack of states when there are actually the same?
    Because they're not the same. The buffer object is different. And the buffer object is part of the state.

  10. #10
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    935

    Re: GL_ARB_vertex_array_object2

    And I would like buffer objects not part of the states but bind to slots. These slots would be part of the states. Couldn't it be as efficient or even more with multiple buffers, a common senario.

Posting Permissions

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