FBO->PBO->VBO

I am doing skinning on the GPU and storing the result in an FBO. I then use PBO/VBO to achieve render-to-vertex array.

It works very well and its very fast if I only use one VBO (the one for the positions). If I use another VBO to specify the normals, the FBO->VBO transfer rate drops by half! (resulting in the same speed as a full readpixel back into RAM).

Moreover, the slowdown occurs only after 10 or 15 frames. As if the driver relealized that something wasn’t right and tries optimizing something.

My code is not the problem: I was able to measure the same behavior using 2 different nVidia VBO examples.

Questions:
Why do I get a performance penalty in the reader-to-vertex-array stage if I specify more than one VBO when drawing?
Is it possible to use more than one VBO to specify your geometry?
Is it important that those VBO have the same size? ie. number of elements?
Can I mix VBO and normal RAM arrays and expect a speed-up?
Are there any GL states that can affect performance? GL_NORMALIZE?

Is it possible to use more than one VBO to specify your geometry?
Yes.

Is it important that those VBO have the same size? ie. number of elements?
Shouldn’t be important. Of course you can only use vertices up to the size of the smallest VBO, but I don’t see why it should matter if one VBO has extra elements (except the wasted memory).

Can I mix VBO and normal RAM arrays and expect a speed-up?
Theoretically you can mix them, but I’d expect the same speed as using RAM arrays only. Perhaps it’s a bit faster, but I wouldn’t count on that. And it’s definitly a lot slower than using VBO only.

Are there any GL states that can affect performance? GL_NORMALIZE?
Of course any GL state could affect performance. It’s hard to say in general, that depends on the state and where your bottleneck is. For example, GL_NORMALIZE may affect performance when you’re vertex bound, but not when your bottleneck is memory transfer or fillrate.

Have you tried using only a single bigger PBO/VBO for both position and normals? I remember reading somewhere that this is not what you’re supposed to do, but it should work, and it’s worth a try :wink:

Originally posted by Overmind:
Have you tried using only a single bigger PBO/VBO for both position and normals? I remember reading somewhere that this is not what you’re supposed to do, but it should work, and it’s worth a try :wink:
Where did you read it ? I’m used to use a single VBO for all vertex attributes.