PDA

View Full Version : Vertex arrays performance



Orzech
08-09-2003, 03:36 AM
Hello

Yesterday I was browsing some documents from game developers metting. I was reading something about increasing OpenGL applications performance and it was said that we should use only glDrawElements in case of vertex arrays. Why is that so? Is glDrawArrays worse? I always thought that glDrawArrays is faster than glDrawElement because it don't have to read this whole index array. Meaby there are some other reasons but the article was rather speed-related.
What do you think about that?

Thanks

Orzech

Some guy
08-10-2003, 10:22 PM
Each vertex will be transformed by a matrix-vector multiplication. The graphic hardware has a vertex cache storing some of the latest transformed vertices, this is the reason why glDrawElements is faster most of the time. The value can be found in the cache from the index if its there.

You are right about what you are writing and glDrawArray should be faster if no vertices is shared between the polygons. If you want to render a real model like a cube is it only 8 different and shared vertices but a lot more polygon vertices.

Orzech
08-11-2003, 12:50 AM
Thanks http://www.opengl.org/discussion_boards/ubb/smile.gif