Which OpenGL calls are performance hit?

Started by
4 comments, last by bios10h 22 years, 1 month ago
Hi, I wrote a simple 3d pool game but I am not satisfied with the fps. I would like to know what are the biggest performance hits in OpenGL (state changes?, texture binding?, polygons rendering?, lighting calculation?). Thanks for any help, Stephane
Advertisement
profile you program to find out where te bottleneck is, there IS no other way.

-Lev
1)use VertexArray or DisplayList(for static geometrie)
If you have a "Geforce" graphic card, try use the extension
"GL_NV_vertex_array_range" to get the best performance in
VertexArray
2)If you use texture mapping, try to reduce
the calls "glBindTexture(...);"
3)try to reduce the texture sizes.
4)if lighting is required, it''s better not to use more than
3 light sources.
5)If you use a lot of texture, try to use texture compression
(GL_EXT_texture_compression_s3tc or GL_ARB_texture_compression)
6)In some situation it''s run faster, if you use GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN instaed of GL_TRIANGLES

how efficient is glDrawElements and glDrawArrays? Where would it fit in your quick list? Is it faster than display lists?
There is a document on nVidia''s site on the performance of various openGL calls. If I find a link I''ll come back and post it.

--------------------------

Those who dance are considered insane by those who cannot hear the music.
Those who dance are considered insane by those who cannot hear the music.
quote:Original post by dynamicman
how efficient is glDrawElements and glDrawArrays? Where would it fit in your quick list? Is it faster than display lists?


A display list is basically a static piece of geometry. Since you cannot edit it, the driver needs only to store the end result of the list. In can store this on the video card in some cases. Draw elements on the other hand is like one big glBegin / glEnd call. It saves time because you only make one call, as opposed to hundreds or even thousands with glBegin /glEnd, but it will likely be slower than the display list because the driver must always copy the whole set of geometry over to the card (even if it has not changed). In the worst case display lists are no slower than drawElements, but they are often faster. If you do not want to use extensions then the standard order to do things is display list (if geometery is static), drawElements (dynamic geometry), glbegin / glend (small batches or where speed doesn''t matter).

This topic is closed to new replies.

Advertisement