VBO performance question.
I am working on an application drawing 2D CAD drawings. Most geometry is of the GL_LINE variety. Though there are a few GL_TRIANGLE types in there as well.
My first pass at it had me using glBegin(), glVertex2f() ..., glEnd() stuff.
Which meant that the geometry was being pushed up to the video card on every draw.
Now, on my second pass at the code, I am implementing vertex buffer objects.
Everything is drawing just fine.
However, I am not seeing any speed improvements.
In fact, some drawings draw even slower when using VBOs.
As an example of my data, here is a breakdown of one file.
It's geometry consists of a total of 28,937 points.
It uses 2020 seperate glDrawArrays() calls.
It has 3 vertex buffer objects. (I make 1 vbo for every 10000 points)
So, in a rendering pass:
- glBindBufferARB() is being called 3 times.
- glVertexPointer() and glDrawArrays() are being called 2020 times. (with different offsets into their respective vbos)
yet this is somehow equal to, or slower than, calling glVertex2f() 28,937 times.
Any ideas on what could be wrong?
What type of things could slow it down?
I am using the static specifier when I feed it my points:
That is supposed to move the data up to the card, right?
glBufferDataARB(GL_ARRAY_BUFFER_ARB, datasize, data, GL_STATIC_DRAW_ARB);
Could something else interfere with that and cause it to keep the points off the card?