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

Thread: VBO question

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2003
    Posts
    8

    VBO question

    Hi all.

    VBO extension spec says it is possible to use separated bindings for individual vertex attribute, right? I'v tried this in my project but it didn't work.
    I do it like this:

    Bind buffer 1;
    glVertexArray (...);
    Bind buffer 2;
    glNormalArray (...);
    ... ...
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);
    glDrawArrays (...)

    if I use one binding for all attribute, it works fine. where is the problem?

  2. #2
    Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    377

    Re: VBO question

    The arrays must be enabled before writing to them. Therefor you have to place your glEnableClientState calls before assigning the arrays.

    hih

    (edit: had to take a closer look at the question before posting)

    [This message has been edited by satan (edited 08-25-2003).]

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2003
    Posts
    8

    Re: VBO question

    It works now! Thank'u and I'll never cross post anymore!

  4. #4
    Intern Contributor
    Join Date
    Oct 2001
    Posts
    69

    Re: VBO question

    "The arrays must be enabled before writing to them. Therefor you have to place your glEnableClientState calls before assigning the arrays."

    Where does it say this in the VBO spec? This doesn't sound correct to me. In fact, it even runs contrary to the examples listed at the end of the vertex buffer object spec.

    If it solved your problem, great, but I'd suspect that something else was going on...

  5. #5
    Junior Member Regular Contributor
    Join Date
    Jun 2003
    Posts
    181

    Re: VBO question

    Looks like a driver bug to me. You didn't mention your hw/driver did you?

  6. #6
    Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    377

    Re: VBO question

    Originally posted by secnuop:
    "The arrays must be enabled before writing to them. Therefor you have to place your glEnableClientState calls before assigning the arrays."

    Where does it say this in the VBO spec? This doesn't sound correct to me. In fact, it even runs contrary to the examples listed at the end of the vertex buffer object spec.

    If it solved your problem, great, but I'd suspect that something else was going on...
    It does not say this in the VBO specs but if you take a look at the glEnableClientState reference you will find for example: GL_VERTEX_ARRAY
    If enabled, the vertex array is enabled for writing and used during rendering when glDrawArrays or glDrawElements is called. See glVertexPointer.

    Therefor I assumed that it is needed for VBO, too.

    As you said this contradicts with the examples shown in the VBO specs so I am not sure what the correct behaviour for an OpenGL implementation should be.

    You and the exmaples are right secnoup. I just tested it and it works flawlessly without enabling the clientstate before assigning the arrays. I did this on a Geforce2MX with the 4496 driver under Linux.

    [This message has been edited by satan (edited 08-26-2003).]

Posting Permissions

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