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?

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).]

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

“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…

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

Originally posted by secnuop:
[b]“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…[/b]

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).]