Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: OpenGL optimizing with arrays

  1. #11

    OpenGL optimizing with arrays

    like Sascha allready pointed out, displaylist are still the fastest way to render static geometry.

  2. #12

    OpenGL optimizing with arrays

    I've tested also with rendering textured and normal coords having models put in vertex array and then in displaylist. Difference was not very noticable but displaylist was slightly faster there. Although there is drawback that displaylist won't be dynamic and will consume more memory than if using pointers to data.

    Also read elsewhere that glDrawElements or glDrawRangeElements are faster than glDrawArrays, also makes vertex indexing possible leading to even less memory use.

  3. #13

    OpenGL optimizing with arrays

    Quote Originally Posted by User137
    I've tested also with rendering textured and normal coords having models put in vertex array and then in displaylist. Difference was not very noticable but displaylist was slightly faster there. Although there is drawback that displaylist won't be dynamic and will consume more memory than if using pointers to data.

    Also read elsewhere that glDrawElements or glDrawRangeElements are faster than glDrawArrays, also makes vertex indexing possible leading to even less memory use.
    Problem with vertex indexing is that you cant have different texture coords or normal for the same vertex (think of a cube, only 8 vertices, but they all need 3 sets of tex coords and normals each), thus any memory gain is lost as you need to unshare the vertices.

    They are faster through.

    Display lists are a tricky subject through, if you're not using any state changes in the list (glBindTexture for instance) they might end up as a VBO instead of a displaylist, thus they are really hard to test for speed in that sence, and thats why its speed can vary so much between different gpu cards and drivers.

    DYNAMIC_DRAW_ARB doesnt make a vertex array more dynamic then GL_STATIC_DRAW, it's just a hint for the driver that the array will be modifyed, it has the option, noting mandatory to put the array in different memory kinds dependig on the hint. (For instance GL_STATIC_DRAW migh end up in the GPU memory, but it could end up in the ram or even the cache).

    The fastest metod i'm avare of is to put all your different meshes and models in one VBO, then using index buffers to render the various models using a vertex shader for the transformation of the objects. Ofcourse this requires a card with shading support.
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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