VBO and glArrayElement

First of all: I know that I should be using glDrawElements or glDrawRangeElements instead.
But currently I am using glArrayElement in my application. I compared VBO to standard vertex arrays and VBO was about 20 percent SLOWER. Is it possible that there is no acceleration when dereferencing single array elements? I cannot see any reason for that. I know that the nvidia drivers are still not optimized, I just want to know if I have to change my code in order to efficiently use VBO.

I am using the latest (43.49) Linux drivers on a GF3.

Tim.

Performance may vary if you use STATIC_DRAW_ARB, DYNAMIC_DRAW_ARB or STREAM_DRAW_ARB, but in any case it should be faster than traditional vertex arrays.
I think drivers are still not fully optimized. On linux with my GF4MX VBO are 90% slower than traditional VA. I guess there is room for alot of improvement.

Originally posted by vincoof:
Performance may vary if you use STATIC_DRAW_ARB, DYNAMIC_DRAW_ARB or STREAM_DRAW_ARB, but in any case it should be faster than traditional vertex arrays.

I am using STATIC_DRAW_ARB, which I guess should be the fastest. I also tried the two others, but that does not change anything.

Originally posted by vincoof:
On linux with my GF4MX VBO are 90% slower than traditional VA.

90 percent slower?? I hope you mean 10 percent.
However, did you use glArrayElement? I am still not shure whether it is only a driver problem or glArrayElement is a bad idea with VBO.

Tim.

Originally posted by hoschi:
However, did you use glArrayElement? I am still not shure whether it is only a driver problem or glArrayElement is a bad idea with VBO.

glArrayElement() is a bad idea period. Batch, batch, batch!

From the tests I’ve done, I’ve found that NVIDIA’s current implementation of VBO maxes out at around 35 MTris/sec regardless of the video card. Still, that’s a lot better than what you can get with traditional vertex arrays.

– Tom

Originally posted by Tom Nuydens:
glArrayElement() is a bad idea period. Batch, batch, batch!

OK, OK. It looks like I really should change my code. I thought I could be lazy and avoid it.

Just in case someone is interested in it:
I made an additional test, this time with a GF4 and now VBO was even about 40 percent slower than traditional VA. (Still using glArrayElement() )

Tim.

Originally posted by hoschi:
90 percent slower?? I hope you mean 10 percent.

Without VBO I get ~18Mtriangles per second.
With VBO for index array, I get the same result.
With VBO for vertex array, I get ~1.5Mtriangles per second.
With VBO for color array, I get ~1.2Mtriangles per second.
In other words, VBO are up to 15 times slower than traditional vertex arrays.
But I think the first linux implementation is not representative.

Originally posted by hoschi:
However, did you use glArrayElement?

I’ve tried both (glArrayElement and glDrawElements) and both give the same result.

Ironically, ArrayElement() could probably be optimized pretty well with VBO, but the reality is that there is very little desire amongst driver engineers to optimize that API path.

You could do the batching yourself with pretty minimal overhead.

Thanks -
Cass

I have changed to glDrawElements. At least that has made VBO as fast as traditional VA. Now I am one of those waiting for the next drivers… (But don’t get me wrong, I am happy that VBO is already in the drivers, even unoptimized right now)

Thanks for your answers.

Tim.