# OpenGL Performance question - display lists

## Recommended Posts

Hi all (again)! I'm working on a demo to learn OpenGL, it's still in the initial development phases, and it's very slow (no vertex arrays, vbo or display lists). In order to get some additional frames per second, I tried to put the platform and background drawing codes (VC6 project and source files included bellow) inside display lists, still, I couldn't notice any changes. Question: Does the usage of display lists really increase general performance? I've always read that it does, but it seems to me that it's not true (maybe I'm doing it the wrong way?). Code used:
// Initializing stage
GLuint platformList;
platformList = glGenLists(1);
glNewList( platformList, GL_COMPILE );
// Many glVertex3f, glNormal and glTexCoord2f here
// Platform is lit textured cube
glEndList();

// Drawing stage
glCallList( platformList );


Thanks! Source + EXE [Edited by - MajinMusashi on November 29, 2004 1:50:06 PM]

##### Share on other sites
You should compile the display list once, and then repeatedly call that list. Re-compiling the list per-frame will essentially be the same as before, quite possibly slower.

- carb

##### Share on other sites
>>Does the usage of display lists really increase general performance? I've always read that it does,<<

no it doesnt, it will only increase performance when u have a certain situations check performance FAQs for details on how to find the bottleneck in your app. FWIW ive found with reasonable shaders the bottleneck aint the polygon rendering method eg immediate/DL/VA/VBO all render the same speed but are limited by the length/complexity of the shader

##### Share on other sites
Quote:
 Original post by carbYou should compile the display list once, and then repeatedly call that list. Re-compiling the list per-frame will essentially be the same as before, quite possibly slower.- carb

Note that I've written "Initialization Stage" and "Drawing Stage", and the compilation process is in the initialization stage, then I compile the list just once, and call it for every frame.

Thanks!

##### Share on other sites
Quote:
 no it doesnt, it will only increase performance when u have a certain situations check performance FAQs for details on how to find the bottleneck in your app. FWIW ive found with reasonable shaders the bottleneck aint the polygon rendering method eg immediate/DL/VA/VBO all render the same speed but are limited by the length/complexity of the shader

Are you trying to say that for newbie programmers like me Display Lists are not that super that people usually say? Could you tell me what are the ideal situations to perceive a certain performance boost?

Thanks!!

##### Share on other sites
>>Are you trying to say that for newbie programmers like me Display Lists are not that super that people usually say?<<

depends on what youre doing, eg in my app that im working on at present, everythings the same speed (though DL's have the downside of using up memory)

>>Could you tell me what are the ideal situations to perceive a certain performance boost?<<

a case that DL's like, drawing lots of verts with no complicated shaders/states to a small screen.

eg i just a ran a small benchmark
(317.8 inds/sec) ( 56.6 v/sec)(105.9 t/sec)TRIS vertex3f GLushort DL
(307.2 inds/sec) ( 54.7 v/sec)(102.4 t/sec)TRIS vertex3f GLushort VBO
(306.1 inds/sec) ( 54.5 v/sec)(102.0 t/sec)TRIS vertex3f GLushort VBO (range)
(304.9 inds/sec) ( 54.3 v/sec)(101.6 t/sec)TRIS vertex3f GLuint VBO (range)
(303.8 inds/sec) ( 54.1 v/sec)(101.3 t/sec)TRIS vertex3f GLuint VBO
(253.0 inds/sec) ( 45.0 v/sec)( 84.3 t/sec)TRIS vertex3f GLuint DL
(205.9 inds/sec) ( 36.6 v/sec)( 68.6 t/sec)TRIS vertex3f GLushort VA (range)
(205.9 inds/sec) ( 36.6 v/sec)( 68.6 t/sec)TRIS vertex3f GLuint VA (range)
(142.3 inds/sec) ( 25.3 v/sec)( 47.4 t/sec)TRIS vertex3f GLushort VA
(141.8 inds/sec) ( 25.2 v/sec)( 47.3 t/sec)TRIS vertex3f GLuint VA
( 45.4 inds/sec) ( 8.1 v/sec)( 15.1 t/sec)TRIS vertex3f GLuint IMMED
( 45.1 inds/sec) ( 8.0 v/sec)( 15.0 t/sec)TRIS vertex3f GLushort IMMED

as u can see immediate is the slowest here BUT keep in mind this is not a real world app

##### Share on other sites
Display Lists are not guaranteed to give a speed boost. They do, however, give the drivers a chance to increase performance. However , most modern 3D drivers will attempt to.

What zedgeek was saying was that if you can send data to the graphics card faster than it can process it, no matter how much you improve the speed of sending data to the card you will see no improvement.

One way this could be happening, is that if it takes longer to clear the screen than if does for you do to send the data to it, and the sending of the data is overlapped with the clearing of the screen, then you get the following effect:

Without display lists:clear: *****************send :  **********draw :                  *******With display lists:clear: *****************send :  ****draw :                  *******

No matter how much you speed up the send operation, because it's not the limiting factor (the bottleneck), you'll never get a speedup. It's not to do with whether you are a newbie or not.

You need to find the limiting factor and fix that. Get something working and then optimise.

##### Share on other sites
Quote:
 Original post by zedzeekcheck performance FAQs for details on how to find the bottleneck in your app.

See the first few pages of the performance pdf in my sig for a flow chart on how to find the slowest part (only a few will be applicable to you however)

[Edited by - _the_phantom_ on November 30, 2004 11:41:33 AM]

##### Share on other sites
Quote:
 See the first few pages of the performance pdf in my sig for a flow chart on how to find the slowest part (only a few will be applicable to you however)

What signature? :) I found it in another post, and I already knew it, but as you say, only a few hints are applicable to me.

Thanks!!!

##### Share on other sites
heh, sorry about that, I do that sometimes, point at my sig and then forget to press the 'include sig' box [grin]

##### Share on other sites
Quote:
 Original post by zedzeek>>Are you trying to say that for newbie programmers like me Display Lists are not that super that people usually say?<>Could you tell me what are the ideal situations to perceive a certain performance boost?<

Very interesting! Thanks,Zedzeek!

##### Share on other sites
Quote:
 Original post by LucidIonDisplay Lists are not guaranteed to give a speed boost. They do, however, give the drivers a chance to increase performance. However , most modern 3D drivers will attempt to....You need to find the limiting factor and fix that. Get something working and then optimise.

Great! I love you all :)

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627701
• Total Posts
2978697
• ### Similar Content

• A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

-What I'm using:
C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.
-Questions
Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?

• Both functions are available since 3.0, and I'm currently using glMapBuffer(), which works fine.
But, I was wondering if anyone has experienced advantage in using glMapBufferRange(), which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
• By xhcao
Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.
• By cebugdev
hi guys,
are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic
let me know if you guys have recommendations.
• By dud3
How do we rotate the camera around x axis 360 degrees, without having the strange effect as in my video below?
Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.
Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.

References:
Code: https://pastebin.com/Hcshj3FQ
The video shows the difference between blender and my rotation:

• 21
• 14
• 12
• 10
• 12