Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Vertex Arrays -> How to improve them ?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    155

    Vertex Arrays -> How to improve them ?

    i'm using lots of vertex arrays for objects in my game.
    i've written a vertexArray-class which can execute the vertex array it holds, it offers several bonus options etc. etc.

    my idea was to replace this class by an 100% compatible one which offers the same function, but is just better and/or faster. -> i wouldn't have to re-code my engine.

    i don't want to use vertex array ranges because there is (still) no arb-extension for them, so i want to give compiled vertex arrays or indexed vertex arrays a try...

    my question is, what could i do to improve the performance or to reduce the memory that is needed ?

    i know that if the array contains just quads, and there are 2 quads sharing 2 points, i could draw them one after another (instead of just drawing them in random order) and make use of the vertex cache (right ?) by sorting the array.

    i've heard i could also save memory by re-use verticles that have already been calculated. is this true ? if yes, how is it done ?
    go vegan

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: Vertex Arrays -> How to improve them ?

    One of the main reasons to encapsulate a vertex array like this is so that you can easily write code for VAR or VAO without having to change the interface. So, you may as well go ahead and implement VAR/VAO versions of these classes, especially considering than an ARB extension is fast approaching.

    my question is, what could i do to improve the performance or to reduce the memory that is needed ?
    If you're already using indexed vertex arrays, you've, pretty much, achieved all you're going to in terms of memory gains. You could, however, consider using smaller sizes for your vertex attributes (say, shorts for texture coordinates, etc).

    As far as performance, CVA's may buy you something, but they are most effective in the case of multipass rendering. Your best bet for improved performance is to go to VAR or VAO. You should be able to implement such systems without having to change your interface.

  3. #3
    Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    371

    Re: Vertex Arrays -> How to improve them ?

    You can use GL_EXT_multi_draw_arrays
    to save on the nbr of DrawElements/DrawArrays calls you make.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2002
    Location
    Espoo, Finland
    Posts
    599

    Re: Vertex Arrays -> How to improve them ?

    Knowing that this is for the trees... By optimizing your vertex arrays, you can get up to 100% speed increases, I think, but that's not going to help you much if forests are what you have in mind. With decent LOD you can make far more concrete speed increases, you basically have to do it at some point. Billboards are very good to start with.

    -Ilkka

  5. #5
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    155

    Re: Vertex Arrays -> How to improve them ?

    what is a billboard ?
    do indexed vertex arrays (i found out how to use them ) just decrease the memory usage or can they also increase the performance ?

    @shorts for texcoords : how to use the coordinate 0.1f 0.2f as shorts ?
    go vegan

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Dec 2002
    Location
    Espoo, Finland
    Posts
    599

    Re: Vertex Arrays -> How to improve them ?

    http://www.lighthouse3d.com/opengl/billboarding/
    Use them for the distant trees, nobody will notice the difference.

    Indexed vertex arrays do increase speed if you use compiled vertex arrays. The shared vertice will get transformed only once.

    -Ilkka

  7. #7
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    155

    Re: Vertex Arrays -> How to improve them ?

    i call that "oldschool doom 2d bitmap zoomed sprites"
    go vegan

  8. #8
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    3,032

    Re: Vertex Arrays -> How to improve them ?

    So you don't use imposters then?
    Your scenes must look so empty...
    Knackered

  9. #9
    Intern Contributor
    Join Date
    Jun 2001
    Location
    San Jose, CA
    Posts
    59

    Re: Vertex Arrays -> How to improve them ?

    Billboards are oreiented toward the viewpoint, they rotate as your viewpoint rotates with respect to them. You can also benefit from them by switching from using blend to alpha_test on the billboards in the distance, you can also rotate the more distance billboards on a less frequent basis than the closer ones. These LOD techniques, and others will give you a far greater performance boost with little or no degradation in visual quality than any brute force vertex pushing technique ever will.

    Heath.

    [This message has been edited by heath (edited 02-16-2003).]

  10. #10
    Advanced Member Frequent Contributor
    Join Date
    Dec 2002
    Location
    Espoo, Finland
    Posts
    599

    Re: Vertex Arrays -> How to improve them ?

    Yep. You call it old school, I call it multiplying the amount of detail in your scene by a BIG number. If it's far, draw it fast, and draw lots of it.

    -Ilkka

Posting Permissions

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