PDA

View Full Version : Display lists have no effect



t3jem
05-30-2005, 08:24 PM
Hi,

I have been trying to create a program with display lists. though when I run it with and without display list it has no effect on my fps.

here is my code using just a cube

void cube
{
draw cube..
}

void dcube -- this initializes my display list
{
begin display list

call cube function

end display list
}

void display
{
if dlist == true
use display list for cube
else
call cube function
}

is there anything else I should do?

RigidBody
05-30-2005, 10:39 PM
draw something more complicated than a cube!
a cube is too simple to get a significant speed-up
with a display list. draw something about
10000 vertices to see a difference.

jide
05-31-2005, 01:34 AM
or drawn hundreds or thousands of your models with and without display lists.

dorbie
05-31-2005, 02:15 AM
Originally posted by jide:
or drawn hundreds or thousands of your models with and without display lists.NO, this may even make things worse, the cube needs to have MANY vertices as RigidBody said.

Display lists are not generally optimized for trivial pieces of geometry.

jide
05-31-2005, 03:36 AM
Really ? Sorry for that. It was an idea in the case he wasn't able (at this time) to have a model using thousands polygons.

Dorbie, how do you know that ? As far as I know, it's not explained on the red book. Any locations explaining such constraints ? Thanx.

ZbuffeR
05-31-2005, 04:28 AM
A display list is a compiled list of OpenGL commands that can be stored in the card. This is mainly useful to avoid the data transfert from cpu to gpu, but has a small fixed cost to call it.
So for millions of small display lists, the fixed cost kills the small gains.

RigidBody
05-31-2005, 05:47 AM
correct me if i'm wrong, but afaik do display lists
not necessarily have to be stored in graphics card
memory.

jide
05-31-2005, 07:35 AM
Originally posted by ZbuffeR:
A display list is a compiled list of OpenGL commands that can be stored in the card.

I know that. This is the main functionnality of display lists though.


Originally posted by ZbuffeR:

This is mainly useful to avoid the data transfert from cpu to gpu, but has a small fixed cost to call it.
So for millions of small display lists, the fixed cost kills the small gains.This logic is not very translucent to my point of view. What I know is that display lists are very good things for storing material properties for example. Materials are very little things (ambient, diffuse, specular and shininess almost only). Those display lists calls of materials can be repeated very often and for several up to many meshes...
So, this would have been a burden regarding the meanings you stippled and so I can't understand why. Or does it mean what I think about display lists and materials is also false ?


Originally posted by RigidBody:

correct me if i'm wrong, but afaik do display lists
not necessarily have to be stored in graphics card
memory.

RigidBody, I think this is because we cannot ensure all graphic cards (and their drivers) will do so, or could do so. As an example, Mesa isn't hardware, so I guess no or few things can be stored directly in the graphic card. But I might be wrong because Mesa display lists are somewhat powerful.

Ehsan Kamrani
05-31-2005, 08:42 AM
Hi Jide
OpenGL is a graphics server for your application.You send the OpenGL calls and it makes a picture based on these calls--Isn't it?
Display lists can be stored in the *server side* and are ready to serve your application. In this case, you send *one call*-glCallList(s)-to the OpenGL and then it immediately does that work for you--Rather than processing many calls independently. In small apps, it is not clear .As an example is there any difference between the 80FPS and 79 FPS? But in full-blown applications, processing-sending- many calls --as an example 10000 calls-Is very different with processing 1 call.
-Ehsan-

jide
05-31-2005, 01:20 PM
sure. forget that all.

t3jem
06-02-2005, 08:29 PM
great, thanks!