Display List versus Vertex Array ??
May 22, 2001 09:05 PM
Vertex arrays are more efficient than display lists, since vertex data can be reused by the GPU. Eg. if many faces share the same vertex, then this vertex needs to be processed multiple times, with vertex arrays it only needs to be converted once. Even better are compiled vertex arrays, although they need to be static. Another interesting vertex array related command is DrawRangeElements. By querying the OpenGL driver you can get the maximum amount of vertices and face indices that the hardware GPU can handle at a time, so you can perfectly adapt your data processing (in terms of speed). This is only available on OpenGL 1.2 though.
I would have to disagree with some of the things said here... Firstly, all a display list does is call (nearly) all the functions you call while you create it. Which will relieve some pressure off the CPU, and some other things it does. But not much. It doesn''t, for example, recognise duplicate vertices.
This means that a DL is only as fast as its written.
so if its written using generic triangles, and glVertex calls, it will be as slow as glVertex calls. (ie, really slow)
It also uses a lot of memory. as it has to make a copy of everything it does.
I have only had about 2-3% boost from using a DL.
A indexed vertex array, on the other hand, when properly used, is MUCH more powerful, especially for ''optimizing'' for hardware T&L.
Because of the way you index verticies, duplicates can be easily ignored (to a certain limit, on a GF, the cache is 16 verticies long)... but most importantly, you almost completly move the drawing code (and its overhead) from your app, to the driver, which will obviously be heavily optimized for this. It will let the CPU continue, while the driver draws whatever you wanted (this only properly happens when using glDrawElements). This being, you can push through massive polygon numbers per second. Assuming your using traingle strips (up to 4 times faster than normal triangles) I can easily push through 3-4 million triangles /sec on my rather old 533. This increases to a massive 13m/tris/sec if you use very VERY simple data types (shorts, and only verticies).
Then there are things like the Vertex Array range nvidia extension, which can litteraly triple the throughput again.
All this can be done in a DL, but with the extra memory it requires (copies of all vertex arrays, etc), its in the long run probably going to slow you down rather than speed your code up.
This means that a DL is only as fast as its written.
so if its written using generic triangles, and glVertex calls, it will be as slow as glVertex calls. (ie, really slow)
It also uses a lot of memory. as it has to make a copy of everything it does.
I have only had about 2-3% boost from using a DL.
A indexed vertex array, on the other hand, when properly used, is MUCH more powerful, especially for ''optimizing'' for hardware T&L.
Because of the way you index verticies, duplicates can be easily ignored (to a certain limit, on a GF, the cache is 16 verticies long)... but most importantly, you almost completly move the drawing code (and its overhead) from your app, to the driver, which will obviously be heavily optimized for this. It will let the CPU continue, while the driver draws whatever you wanted (this only properly happens when using glDrawElements). This being, you can push through massive polygon numbers per second. Assuming your using traingle strips (up to 4 times faster than normal triangles) I can easily push through 3-4 million triangles /sec on my rather old 533. This increases to a massive 13m/tris/sec if you use very VERY simple data types (shorts, and only verticies).
Then there are things like the Vertex Array range nvidia extension, which can litteraly triple the throughput again.
All this can be done in a DL, but with the extra memory it requires (copies of all vertex arrays, etc), its in the long run probably going to slow you down rather than speed your code up.
NVidia says that display lists are faster than vertex arrays (even compiled vertex arrays).
You can find more information about that in the following document:
http://www.nvidia.com/Marketing/Developer/DevRel.nsf/3e0a464ce391addc8825681700740113/f706b8da926e1c548825685c006763d8/$FILE/GeForce_FAQ_04.pdf
You can find more information about that in the following document:
http://www.nvidia.com/Marketing/Developer/DevRel.nsf/3e0a464ce391addc8825681700740113/f706b8da926e1c548825685c006763d8/$FILE/GeForce_FAQ_04.pdf
Four words which seem to sum up this thread: YMMV
I expect the display lists v vertex arrays issue varies from implementation to implementation so I''d be surprised if anyone could give a definitive answer either way.
I expect the display lists v vertex arrays issue varies from implementation to implementation so I''d be surprised if anyone could give a definitive answer either way.
I thought in vertex arrays that when it manages duplicate vertices that they are constrained to use the same normal?
this is all driver + application specific the only way to find out is to test.
but basically the general rule is display lists are the fastest BUT they come with a couple of big restrictions
1/ u can''t change the data without recompiling the list
2/ they use up memory on the card
in theory it shouldnt make a difference if u use glBegin()..glEnd() or vertex arrays in a display list
there was a demo at nvidia (prolly still is) called spheremark it draws a simple scene with various methods DL,vertex arrays,lighting on/off etc + benchmarks the speed
http://members.xoom.com/myBollux
but basically the general rule is display lists are the fastest BUT they come with a couple of big restrictions
1/ u can''t change the data without recompiling the list
2/ they use up memory on the card
in theory it shouldnt make a difference if u use glBegin()..glEnd() or vertex arrays in a display list
there was a demo at nvidia (prolly still is) called spheremark it draws a simple scene with various methods DL,vertex arrays,lighting on/off etc + benchmarks the speed
http://members.xoom.com/myBollux
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement