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 5 of 5

Thread: Concept of VBO VAO and IBO..??

  1. #1
    Junior Member Newbie mkashif's Avatar
    Join Date
    Oct 2013
    Posts
    5

    Concept of VBO VAO and IBO..??

    Salam, Hi guys,, i found many tutorials about how VBO's, and VAO's works, but i don't get the actual concept. Actually i beginner to Opengl in fact I have directly started the modern opengl, now let come to the actual question,

    glEnableVertexAttribArray(0), some time they use it for disabling purposes, but some time they use it for indexing VAO, like

    glEnableVertexAttribArray(0) => vertices
    glEnableVertexAttribArray(1) => normals
    glEnableVertexAttribArray(2) => colors,

    plz reply for my question. i apologies if i have posted my question in wrong section, thanks,

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,216
    Vertex attribute arrays are arrays of data you can feed into your vertex shaders, one element from each array at a time.

    The "contents" of vertex attribute arrays can be provided to the GPU in either VBOs (GPU arrays), or in compatibility OpenGL, client arrays (CPU arrays). Note that GPU and CPU arrays is not quite correct -- it's actually driver-side and app-side, respectively. But you get the jist.

    These vertex attribute arrays are bound in some form to vertex attribute slots, and these slots are enabled/disabled before you issue a batch draw call.

    Now you can do these binds and enables (lazily of course) followed by a batch draw every time you need to render the batch. OR (in ordinary OpenGL) you can create a VAO to store off these binds and enables so that later all you do is bind the VAO and then issue your batch draw call. Binding the VAO does all the slot binds and enables internally (VAOs are just a binding speedup). Re VAOs, if you have an NVidia GPU you can use bindless vertex attributes instead of VAOs, which in my experience gives you even better performance.

    So briefly:

    VBOs - Store the "contents" of vertex attribute or index arrays
    VAOs - Store the "bindings" and "enables" associated with vertex attribute slots and/or index list slots
    Last edited by Dark Photon; 10-03-2013 at 05:49 PM.

  3. #3
    Junior Member Newbie mkashif's Avatar
    Join Date
    Oct 2013
    Posts
    5
    thanks for reply,
    Then what does this mean?

    glEnableVertexAttribArray(1) => enable
    glEnableVertexAttribArray(0) => disable

    aren't the the 0,1,2,3 are the attributes slot in VAO for each VBO's? => position , color, normals

    which attribute is going to enable and disable?

  4. #4
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    495
    Quote Originally Posted by mkashif View Post
    thanks for reply,
    Then what does this mean?

    glEnableVertexAttribArray(1) => enable
    glEnableVertexAttribArray(0) => disable

    aren't the the 0,1,2,3 are the attributes slot in VAO for each VBO's? => position , color, normals

    which attribute is going to enable and disable?
    The above commands enable the arrays for attributes 0 and 1. To disable an an array, use glDisableVertexAttribArray().

  5. #5
    Junior Member Newbie mkashif's Avatar
    Join Date
    Oct 2013
    Posts
    5
    Thank you very much. i was confused, now i get it , thanks

Posting Permissions

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