Jump to content
  • Advertisement
Sign in to follow this  
Tree Penguin

Display List vs VBO?

This topic is 5053 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Switch to glDrawElements and use an IBO - i'm guessing the DL is faster because it's been optimized.

Y.

Share this post


Link to post
Share on other sites
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 :]).

Share this post


Link to post
Share on other sites
>>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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
>>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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!