PDA

View Full Version : how small is a "small" display list?


Diplomtennis
2004.10.29, 10:47 PM
hi,

in the redbook it says:
Although you're not guaranteed that your OpenGL implementation optimizes display lists for any particular uses, the execution of display lists isn't slower than executing the commands contained within them individually. There is some overhead, however, involved in jumping to a display list. If a particular list is small, this overhead could exceed any execution advantage.

now, does anyone know how small is "small"? e.g. does it make sense to store a low polygon object with lets say 12 gl_triangles into a display list, or will this affect performance?

d.

ThemsAllTook
2004.10.30, 12:04 AM
The numbers I've heard are: Fewer than 10 vertices are more efficient in immediate mode than in a vertex array, and fewer than 100 vertices are more efficient in a vertex array than in a display list. I have no idea how accurate those numbers are, as I haven't benchmarked them myself...

Alex Diener

skyhawk
2004.10.30, 02:10 AM
according to the apple video, if there are less than 16 polys, it doesn't optimize the list at all. Also, when passing data to display list, try to keep it in a consistent format, cause apple's drivers will detect that and try to optimize them. other than that, if you got a static object, I suggest you put it in a display list.

OneSadCookie
2004.10.30, 02:37 AM
amusing story about the consistency of data... I put this into a display list:

glBegin(GL_TRIANGLES);
for about 1000000 times
{
glColor3f
18 glVertex2f calls
}
glEnd();

That was taking about 2 minutes to compile into a display list

I changed the code to look like this:

glBegin(GL_TRIANGLES);
for about 1000000 times
{
18 x glColor3f followed by glVertex2f
}
glEnd();

and display list compilation time went down under 1 second.

Diplomtennis
2004.10.30, 02:10 PM
ok, thanks. So I guess I know where to go:
I put my objects into vertex arrays and the whole scene, which does not need to be transformed into a display list, right?
d.

Hog
2004.10.31, 01:38 PM
amusing story about the consistency of data...

display lists somehow behave quite differently on different hardware. on nvidia cards compiling immediate mode calls into a display list seems to make calling the lists extremely slow. my guess is that ati cards somehow optimize the lists or store them completely different than the geforce cards i've tried (drawing vertex arrays into lists works fine on the other hand).