PDA

View Full Version : GL_ELEMENT_ARRAY_BUFFER_ARB



Bumper
09-26-2004, 01:38 PM
Anyone know why I do not get any speed improvement when I use GL_ELEMENT_ARRAY_BUFFER_ARB?

I make some tests:

I draw 260000 vertices (GL_POINTS)

glDrawArrays
vertices in system memory -> 63 fps
vertices in video memory -> 380 fps
(speed improvement because I dont tranfert 3 Mb (260000 * 3 float) via the bus every frame)

glDrawElements
vertices in system memory -> 58 fps
vertices in video memory -> 160 fps
(slower than glDrawArrays because I tranefrt 1 Mb (260000 vertices) via the bus every frame)

glDrawElements
indices in system memory -> 160 fps
indices in video memory -> 156 fps
(so I use VBO extension to store indices in video memory. But I do not get speed improvement).

Therically, I think that the last method should be equal in term of performance to glDrawArrays with vertices in video mem, but it is not the case.

I really dont understand why? and what is the goal of GL_ELEMENT_ARRAY_BUFFER_ARB in this case???

PS: My graphic card is a GeForce 6800 GT

Korval
09-26-2004, 01:43 PM
Therically, I think that the last method should be equal in term of performance to glDrawArrays with vertices in video mem, but it is not the case.The card still has to read the indices, convert them into video memory pointers, and then read the actual vertex data. This takes longer than just running through some vertex memory.


My graphic card is a GeForce 6800 GTUnless something changed with GeForce 6xxx cards, they have never been known for getting much benifit from having array index buffers. ATi cards, on the other hand, do tend to benifit from this. My suggestion is to stick with it; cards where it doesn't help will simply store element buffers in system memory, and cards where it does will gain performance.