Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: vertex buffer object and Display list

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2009
    Location
    R
    Posts
    13

    vertex buffer object and Display list

    Hi all,

    I use Display list in my first project and I use vertex buffer object in my second project. DL shows better FPS than VBO, why? And second question, is GeForce 8XXX generates indexex for for repeating points in VBO geometry?

    P.S. Sorry if my problem has been discussed, I bad speak english.

  2. #2
    Member Regular Contributor DmitryM's Avatar
    Join Date
    Mar 2009
    Location
    Toronto
    Posts
    435

    Re: vertex buffer object and Display list

    1. Well, if you don't draw much data, but rather frequently change OpenGL state, then DL might be faster.
    Anyway, comparing these draw methods is as old as world.
    Use VBO for drawing geometry and DL for anything else you like.

    2. The driver will _not_ go through all attributes and compare them to create index buffer internally.

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256

    Re: vertex buffer object and Display list

    There could be several reasons:
    VBO state change can be expensive. If you have 10,000 VBOs and each is for rendering a few quads, then rendering all those will be slow. Make 1 big VBO for all.
    Perhaps DL are slow if used in this fashion as well.

    Using certain formats like double or byte for vertices or what have you can force the driver to convert the data live, every time you render with your VBO.
    For DL, it would be faster in this case.

    You can read about VBOs here
    http://www.opengl.org/wiki/General_OpenGL

    and more stuff here
    http://www.opengl.org/wiki/Common_Mi...d_formats_.231
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  4. #4
    Junior Member Regular Contributor
    Join Date
    Aug 2009
    Posts
    130

    Re: vertex buffer object and Display list

    I've noticed that for extremely large data sets, creating a display-list with immediate mode rendering (glBegin, glEnd) is much slower than VBOs if you have a newer card (tested on the ATI Radeon 4870x2), but faster than VBOs if you have an older card (ATI radeon x1950).

  5. #5
    Junior Member Newbie
    Join Date
    Nov 2009
    Location
    R
    Posts
    13

    Re: vertex buffer object and Display list

    I think the reason is something else. Maybe I bad told about my VBO project?

    This is a Delphi code:
    var vertexBuffer:GLInt;

    type
    Vertex=array[0..1] of GLFloat;

    var
    Vertexes:array of Vertex;

    Procedure VBOInit;
    begin
    glGenBuffers(1, @vertexBuffer);

    glBindBuffer( GL_ARRAY_BUFFER, vertexBuffer);
    glBufferData( GL_ARRAY_BUFFER, sizeof(GLFloat)*(high(Vertexes)+1), @Vertexes[0], GL_STATIC_DRAW );
    glVertexPointer( 2, GL_FLOAT, 0, nil);
    glBindBuffer( GL_ARRAY_BUFFER, vertexBuffer);
    end;

    procedure TForm1.GLDirectOpenGLRender(Sender: TObject;
    var rci: TRenderContextInfo);
    begin
    glEnableClientState( GL_VERTEX_ARRAY);
    glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
    glVertexPointer( 2, GL_FLOAT, 0, nil);
    glDrawArrays(GL_TRIANGLES, 0, 6);
    glDisableClientState(GL_VERTEX_ARRAY);
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    setlength(Vertexes,6*2);
    Vertexes[0][0]:=-1; Vertexes[0][1]:=-1;
    Vertexes[1][0]:=1; Vertexes[1][1]:=-1;
    Vertexes[2][0]:=1; Vertexes[2][1]:= 1;
    Vertexes[3][0]:=1; Vertexes[3][1]:= 1;
    Vertexes[4][0]:=-1; Vertexes[4][1]:= 1;
    Vertexes[5][0]:=-1; Vertexes[5][1]:=-1;

    VBOInit;
    end;

    procedure TForm1.FormDestroy(Sender: TObject);
    begin
    glDeleteBuffers(1,@vertexBuffer);
    end;

    Procedure TForm1.FormCreate use once in project start. Procedure GLDirectOpenGLRender use for rending two triangles. I use GLScene (www.glscene.org), but in this project I almost (http://translate.google.ru/translate_t?prev=hp&hl=ru&js=y&text=%D 1%80%D0%B0%D1%81%D1%81%D0%BA%D0%B0%D0%B7%D0%B0%D0% BB&file=&sl=ru&tl=en&history_state 0=#ru|en|%D0%BF%D0%BE%D1%87%D1%82%D0%B8) do not it's functional.

    My project with DL use GLScene only because it do not know about VBO =) and use older display list. if necessary I can show this source code.

    "2. The driver will _not_ go through all attributes and compare them to create index buffer internally."
    Sorry, I do not understand, fps would be better if I created indexes for VBO?

    Thanks for your answers!!!

  6. #6
    Member Regular Contributor DmitryM's Avatar
    Join Date
    Mar 2009
    Location
    Toronto
    Posts
    435

    Re: vertex buffer object and Display list

    As long as you draw 2 triangles there is no sense of arguing about speed
    First, make a scene with 100k triangles - the difference between DL and VBO will become obvious.
    Next, use indices (in case your geometry is smooth) and see how caching vertex data helps the performance.

  7. #7
    Junior Member Newbie
    Join Date
    Nov 2009
    Location
    R
    Posts
    13

    Re: vertex buffer object and Display list

    Quote Originally Posted by DmitryM
    Next, use indices (in case your geometry is smooth) and see how caching vertex data helps the performance.
    I written:"is GeForce 8XXX generates indexex for for repeating points in VBO geometry?" because in my GeForce 8800 GT with indexes 4446 fps and without indices 4446 fps!

  8. #8
    Member Regular Contributor DmitryM's Avatar
    Join Date
    Mar 2009
    Location
    Toronto
    Posts
    435

    Re: vertex buffer object and Display list

    Again, there is no point of measuring speed difference if you have more than 1000 fps. Try more complex data.

  9. #9
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,319

    Re: vertex buffer object and Display list

    Quote Originally Posted by DungeonLords
    ...because in my GeForce 8800 GT with indexes 4446 fps and without indices 4446 fps!
    Read this: Performance (Humus) and The evils of fps (RTR blog)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •