View Full Version : Slow VBO Bunnies

09-09-2003, 06:01 AM
Hi all,

OK, here's the deal.
Loading the stanford bunny OK. Runs at 6.75 mpoly/sec using glDrawElements from system RAM.
Same mesh from a VBO gives me 2.9mpoly/sec. Somewhat less than spectacular.

I'm guessing the fault is with my code (below). Any ideas?

// Setup VBO
glGenBuffersARB( 1, &VBO_VertBuff );
glGenBuffersARB( 1, &VBO_NormBuff );

// Copy Vertex and Normal data into VBOs
glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBO_VertBuff );
glBufferDataARB( GL_ARRAY_BUFFER_ARB, NumVerts*sizeof(CVector3), pVerts, GL_STATIC_DRAW_ARB );
glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBO_NormBuff );
glBufferDataARB( GL_ARRAY_BUFFER_ARB, NumVerts*sizeof(CVector3), pVertNormals, GL_STATIC_DRAW_ARB );

if( UseSystemRAM ) // 6.75 mpoly/sec
glDeleteBuffersARB( 1, &VBO_VertBuff );
glDeleteBuffersARB( 1, &VBO_NormBuff );

glVertexPointer( 3, GL_FLOAT, 0, pVerts );
glNormalPointer( GL_FLOAT, 0, pVertNormals );
elseif( Use VBO ) // 2.9 mpoly/sec
glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBO_VertBuff );
glVertexPointer( 3, GL_FLOAT, 0, BUFFER_OFFSET(0) );
glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBO_NormBuff );
glNormalPointer( GL_FLOAT, 0, BUFFER_OFFSET(0) );

glDrawElements( GL_TRIANGLES, NumFaces*3, GL_UNSIGNED_INT, pFaces );

-Athlon 24000
-512MB RAM
-GeForce 4200 (det45.23)
-VC6 (spack5?)

[This message has been edited by MojoMagic (edited 09-09-2003).]

[This message has been edited by MojoMagic (edited 09-09-2003).]

[This message has been edited by MojoMagic (edited 09-09-2003).]

09-09-2003, 06:12 AM
As you can see this is very hacky... Even for pseudo-code (sorta).
But is there anything fundamentally wrong with what I'mm doing?

09-09-2003, 06:16 AM
Originally posted by MojoMagic:
-Athlon 24000

Maybe your system is overclocked a bit too much?


09-09-2003, 07:17 AM
Tried with UNSIGNED_SHORT indices and/or indices in an ELEMENT_ARRAY_ARB VBO?

09-09-2003, 07:29 AM
And what is the speed if you use VBO for the indices also?

09-09-2003, 10:03 AM
GeForce 4200 (det45.23) this combo run very slowly, as the driver has a bad optimisation for VBO, try 44.03 they was better imho.

But in my case the perf aren't so slow, it's just like a raw pointer in sys ram. Maybe you got another problem, or it's nvidia drivers misoptimization too.

09-09-2003, 11:32 AM
Dont use 2 Vbos at the same time.
Try an interleaved format.