Display List vs VBO?

Started by
23 comments, last by python_regious 19 years, 8 months ago
Hi, i tested VBOs, VAs and Display lists for their speed. Display Lists appeared to be almost two times as fast as VBOs. Did i do something wrong (i thought VBOs would be faster)? I know the advantages of VBOs are the fast loading and low memory consumption, are there any others?
Advertisement
Quote:Original post by Tree Penguin
Did i do something wrong

Most probably, yes :)

Quote:
I know the advantages of VBOs are the fast loading and low memory consumption, are there any others?

They're supposed to be the fastest way to render geometry.

Post the code you used to set up the VBO. Also, your hardware and driver revision.
What was the speed of the standard VA vs the VBO? It seems as though the VBO wasn't resisdent in video memory.

What card/drivers do you have?
If at first you don't succeed, redefine success.
Bah, I was beaten to it.
If at first you don't succeed, redefine success.
Ok, the framerates:

glVertex3f and glTexCoord2d calls: 2
Display List: 93
Vertex Arrays: 6
VBO: 54

That's when i render a 512*512 point heightmap (with a 512*512 size texture) using just simple triangles (so 511*511*3*2=1566726 vertices) in windowed mode, 640x480x32, on an ATI Radeon 9600XT 128MB.
All triangles are visible (and take up about two thirds of the screen), culling is off, lighting is off.

#############################################################
VBO drawing code:

glEnableClientState( GL_VERTEX_ARRAY );
if(dataTexCoords)glEnableClientState( GL_TEXTURE_COORD_ARRAY );

glBindBufferARB( GL_ARRAY_BUFFER_ARB, VerticesID );
glVertexPointer( 3, GL_FLOAT, 0, (char *) NULL );

if(dataTexCoords){
glBindBufferARB( GL_ARRAY_BUFFER_ARB, TexCoordsID );
glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL );
}

glDrawArrays( DrawingPrimitive, 0, nVertices );

glDisableClientState( GL_VERTEX_ARRAY );
if(dataTexCoords)glDisableClientState( GL_TEXTURE_COORD_ARRAY );

#############################################################
VBO setup code:

glGenBuffersARB( 1, &VerticesID );
glBindBufferARB( GL_ARRAY_BUFFER_ARB, VerticesID );
glBufferDataARB( GL_ARRAY_BUFFER_ARB, nVertices*3*sizeof(float), dataVertices, GL_STATIC_DRAW_ARB );

if(dataTexCoords){
glGenBuffersARB( 1, &TexCoordsID );
glBindBufferARB( GL_ARRAY_BUFFER_ARB, TexCoordsID );
glBufferDataARB( GL_ARRAY_BUFFER_ARB, nVertices*2*sizeof(float), dataTexCoords, GL_STATIC_DRAW_ARB );
}

############################################################

I might even have copy pasted these lines out of the NeHe VBO tutorial.

BTW, DrawingPrimitive is an unsigned int variable that holds values like GL_TRIANGLES (in this case) or GL_TRIANGLE_STRIP.

Switch to glDrawElements and use an IBO - i'm guessing the DL is faster because it's been optimized.

Y.
Quote:Original post by Ysaneya
Switch to glDrawElements and use an IBO - i'm guessing the DL is faster because it's been optimized.

Y.

IBO? Index Buffer Object or something like that?

The only way the DL could be faster than a VBO is the fact that texcoords and vertices are stored together (instead of jumping back and forth it can just go through all the data without large jumps. I cannot think of another reason (or maybe that the VBOs are for some reason very badly used by the latest ATI drivers but i don't think that's the case :]).
>>511*511*3*2=1566726 vertices<<

this is way to much to draw in one call.
try

glGetIntegerv( GL_MAX_ELEMENTS_INDICES, &max_elements_indices );
glGetIntegerv( GL_MAX_ELEMENTS_VERTICES, &max_elements_vertices );

to give u an idea of the figures u whould be calling
I tried it on my Ti4200 (i'm back home) and it resulted in 1243784 (vertices) so i am just a little over the limit (or maybe under it at the radeon).
Anyway i tried display lists, VAs and VBOs at the ti and i got these averages, all measured several times and all had the same results (these are averages which might not be completely right, but the order is right):

DL: 120
VA: 115
VBO: 110

VSync is off and i used the NeHe tutorial 45 unmodified, i only added display list drawing code.

I am a little confused, everyone is telling me VBOs are way faster than display lists, if a card supports it. I have never had that same experience, not even the NeHe tutorial which stated the VBOs added the FPS boost everyone dreamed of. It did when compared to VAs on the radeon but it still looks strange to me that a simple DL beats it, especially in the way it did at the radeon.

I guess the VBOs just hate me [bawling].

Any suggestions/questions/corrections/blessings are welcome.
>>Any suggestions/questions/corrections/blessings are welcome.<<

read my last post,
also check out the pdf's from nvidia.
VBO's are morre difficult to set up correctl;y than DL.

also a lot of the code at nehe's site is just plain bad (ie dont take it as gospel)

This topic is closed to new replies.

Advertisement