Advertisement

Display Lists

Started by January 30, 2005 01:28 PM
12 comments, last by cippyboy 19 years, 9 months ago
Well I`ve to some point where I have a lot of rendering options per material and... to my dissapointment Display Lists are way slower than the normal rendering(Arrays->DrawElements). I was wondering if there`s a ListMaximumSize or something like that, and if something like... modifying the texture matrix for each object can slow down rendering ?

Relative Games - My apps

Weird, for me display lists are faster then vertex array, what card do you have? ATi or NVIDIA?
______________________________________________________________________________________With the flesh of a cow.
Advertisement
There is an simple reason for this confusion.

Displaylists precalcylates all coordinates and thus when you render them they have a huge speed increase since they do not have to do all those matrix transformations all the time.

However, if you move them around or somehow change them, then it will be slower than normal because it has to recalcylate everything for every frame or action.

So my suggestion is that if it's not static on the screen all the time then don't bother using it (it could still be usefull in some places though to simplyfy things), VBO's are better for that.
I`m thinking to revisit my initialisation process, It`s just seems lame to have in Frustum 360 Objects with about 10 000 Polygons and only get 90 FPS(and I also got animated objects), with lists it gets to 65 and they also get non-animated :)).

Oh I have a Radeon 9550 128 MB which is way better than my GeForce 5200, when I first got it, I was testing some scene, I was getting 100 frames +, well it had lesser polygons :D

I just made a small test, just by removing these lines
glDisable(GL_BLEND);		glDepthFunc(GL_LEQUAL);glDisable(GL_CULL_FACE);glDisable(GL_VERTEX_PROGRAM_ARB);glDisable(GL_FRAGMENT_PROGRAM_ARB);


I Get 2-3 frames plus; I use those to reset any rendering state I might have used.

Plus, when I render nothing with the color and depth cleared, I only get 460 FPS... and I saw some cell shading demo running with 700+ FPS, and he was rendering something... I mean... wtf is going on ?

Relative Games - My apps

Pre-Thanks to the applause :D

I just made something I called "Object Grouping", and guess what ? I almost DOUBLED!! my rendering speed, I now have 160 FPS, and... to the odds of it, compared to the full scale rendering(All the scene)previously which lead to about 47 frames, now I get something like 140... now that`s something really interesting.

But how it`s curently done can`t actually be used in lists, what I could compile is the glDrawElements part... does it make the effort ? I`m gonna check ;)

Relative Games - My apps

Quote: Displaylists precalcylates all coordinates and thus when you render them they have a huge speed increase since they do not have to do all those matrix transformations all the time.
Nope. OpenGL vertexarrays are stored in systemmemory without VBO. Displaylists can reside in displaymemory, thus they are faster.
Advertisement
This link describes displaylists a little bit closer.
Basicly displaylists store opengl commands, it allso compiles those commands at the same time, how this is done and compiled into what i don't know, but i am guessing it depends on the drivers.
While compiling it's logical to asume that it does all the matrix calcylations before storing the result.
The document i linked to is pretty clear, i suggest you read it and all the others at this place, and perhaps you will learn from it.

O, and by the way noVum, vertexarrays and display lists are not the same thing.
Vertex arrays are placed in the system memory(if they are not VBO, in witch case they reside in the GFX memmory), not the displaymemory if there even is such a thing.

Funny thing, if you use Vertex arrays in a display list they will not be compiled and thus most of that huge speed boost is lost.
Quote: Original post by lc_overlord
Funny thing, if you use Vertex arrays in a display list they will not be compiled and thus most of that huge speed boost is lost.


Fucking shit... I`m using ONLY indexex arrays, so what does that mean ? that I gotta go to glBegin/glEnd to get more speed ?

Oh and by the way, I have large indexed objects... If I turn those into surfaces, and then into GL_FANS, will I get more speed ? Thus editing them will be way harder, but I`d do anything for speed :D

Oh and by the way I tryed to compile Only the glDrawElements command, it was kinda weird to see all objects having a color from the result of the 3 unit texturing, basicly what I got was untextured polygons...

One more thing, I have a SetArrays Func that sets the OpenGL pointers to vertices/texcoords/normals, If I insert that into each display list, it gets like 1/3 of the normal rendering speed, then I put it into a separate list, and I get 2/3 of the normal speed

PS:What`s the difference between display lists and VBO-s ? Is it... like a compiled glDrawElements ?

Relative Games - My apps

Quote: Original post by cippyboy
Fucking shit... I`m using ONLY indexex arrays, so what does that mean ? that I gotta go to glBegin/glEnd to get more speed ?

Perhaps, use the fastest method, try everything and see what happens, it all depends on what you use it for.

Quote: Original post by cippyboy
Oh and by the way, I have large indexed objects... If I turn those into surfaces, and then into GL_FANS, will I get more speed ? Thus editing them will be way harder, but I`d do anything for speed :D

No, GL_FANS produces triangles and thus dosn't give mutch of a speed increase if you use displaylists, you get some speed improvement with trifans if you do normal rendering, but it's insignificant.

Quote: Original post by cippyboy
One more thing, I have a SetArrays Func that sets the OpenGL pointers to vertices/texcoords/normals, If I insert that into each display list, it gets like 1/3 of the normal rendering speed, then I put it into a separate list, and I get 2/3 of the normal speed

If it's slower, why use it?

Quote: Original post by cippyboy
PS:What`s the difference between display lists and VBO-s ? Is it... like a compiled glDrawElements ?

Not even close, VBO's and vertex arrays are basicly an array of vertics that can be renderd pretty dam fast.
I currently use them only on the world geometry(around 6000 polys) in my game engine, when when i switch from normal rendering to VBO style rendering the fps goes from 45 to 58 so it's a pretty significant speed increase when you take in concideration that i use vbo's for only 18000 polys out of 35000.

Displaylists on the otherhand contain compiled opengl commands, they are less flexible and all that, but they are usefull for static objects and so on and on and on yadda yadda yadda......
About the indexed vertices I was talking earlyer... My current implementation is this : I put all vertices/normals/texcoords in a really Huge Array, then all the indices in a really huge Index Array(PS:I once saw that using Intervealed arrays produces 0 more performance) so rendering is something like:

glDrawElements(GL_TRIANGLES,nrindices,GL_UNSIGNED_INT,Indices+offset);

I once thought of uniting objects that are near and share the same material. Oh and this way I avoid re-seting the pointers for each object. I was wondering if anyone tryed both methods, Object-Array or Full-Array. I was guessing that my speed decrease in lists is because it (probably ?) puts the whole array in the display list and I only render a fraction of it, making it pretty unusable.

Also I was wondering... What`s Faster ? Having a large number of objects with a small number of polygons or having lesser objects with much more polygons thus decresing the number of function calls ?

Relative Games - My apps

This topic is closed to new replies.

Advertisement