I've been trying to do some simple tests to see the benefits of vertex arrays, and get a feel for them. Unfortunately, I seem to be getting slower performance using them than in immediate mode. I'm using a Radeon 9700 with the latest drivers. I'm pretty sure I must have missed something or be under the wrong impression about vertex arrays, but it doesn't hurt to ask, so...
I have an array of verteces called heightValues, which, in my basic test, has a length of 750,000 (250,000 verteces each with x, y and z coords). I also have an array of indicies to be used as a triangle strip, which is 500,000 elements long.
This is the code I use for the vertex array test:
// width and height are each 500
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, heightValues);
glDrawElements(GL_TRIANGLE_STRIP, height * width * 2, GL_UNSIGNED_INT, indicies);
glDisableClientState(GL_VERTEX_ARRAY);
And this is what I use for the immediate mode test:
glBegin(GL_TRIANGLE_STRIP);
for(int count=0; count<height * width * 2; ++count)
glVertex3f(heightValues[ indicies[count]*3 ], heightValues[ indicies[count]*3 +1 ], heightValues[ indicies[count]*3 +2 ]);
glEnd();
Aside from that, there isn't much going on. My rendering loop is pretty sparse, with just a couple of matrix transformations to position the output. The performance is about 36fps using vertex arrays, and 55fps using immediate mode. The issue is this: I wouldn't imagine that the vertex arrays could produce slower results when using large numbers of verteces, when both pieces of code give the same results. Anyone who can settle this would be greatly appreciated.