I am currently running some speed tests for my applications and I am trying to find more ways to optimize my program, specifically with my display lists. Currently I am getting:
12 FPS with 882,000 vertices
40 FPS with 234,000 vertices
95 FPS with 72,000 vertices
I know that I need to minimize the number of calls made, so instead of:
for(int i = 0; i < Number; i++) {
glBegin(GL_QUADS);
...normal and vertex declarations here
glEnd();
}
A better way would be to do this:
glBegin(GL_QUADS);
for(int i = 0; i < Number; i++) {
...normal and vertex declarations here
}
glEnd();
This did help increase my FPS to the results listed above, however, are there other ways I can optimize my display lists? Perhaps by using something other than nested vertex arrays to store my model data?
You’ll get a significant speed boost by switching to VBOs or at least Vertex arrays.
Immediate mode (
glBegin()...glEnd()) has a lot of method call overhead. I’ve managed to render ~1 million vertices at several hundred fps on a laptop (would be faster without the physics engine/entity system overhead too) by using more modern OpenGL.If you’re wondering about compatibility, about 98% of people support the VBO extension (
GL_ARB_vertex_buffer_object) http://feedback.wildfiregames.com/report/opengl/