Rayne's picture

DrawElements w/ VBO slower than DrawArray...why?

I've been using DrawArrays to draw several objects. I realized that many of these objects have common vertices, so I cerated a single VBO with all possible vertices (~80K), then used drawelements. I expected a slight increase in performance from reduced data transfer. What I got is over a 50% decrease in FPS. I tried the same code on two other computers. One showed no difference, the other had a 25% increase in FPS.

Here are the computer stats:

Comp #1 (50% decrease)
Win 7 32-bit, ATI Radeon HD 4300, OpenGL v. 3.3 Comparability Profile Context

Comp #2 (25% increase)
Vista 64-bit, NVIDIA Quadro FX 2700M, OpenGL v. 2.1.

Comp #3 (no difference)
Win 7 64-bit, Mobile Intel 4 Series Express Chipset Family, OpenGL v. 2.1

I'm not surprised #3 had no difference since its integrated graphics, but why #1 got worse and #2 got better with the same code is beyond me. I suspect its a driver issue, but I can't find anyone with a similar card and these problems.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

It's better to use seconds per frame as a metric, rather than frames per second. A 50% decrease in FPS applies to both 600fps->300fps (1.6ms slower) and 60->30fps (16.6ms slower) - obviously the second is much worse decrease in performance.

VBOs tend to have an optimal size which may differ from card to card and driver to driver. As a rule of thumb, the optimal size lies between 1024 and 65536 vertices (using 16bit offsets, rather than 32bit). If you limit your VBO size artificially to, say, 10K vertices, does the performance decrease still occur?

Updating your drivers is also a good idea.