vince

01-11-2007, 03:13 PM

I'm wondering which way to render the following VBO will be the fastest. The goal is to render a grid with a equal number of rows and column. The grid is relatively large: 128x128

1- Using gl(Multi)DrawArrays. Each point needs to be in the VBO twice because all vertex are used in sequential order, so it need to be there in each row using this vertex. It has the advantage of not jumping back and forth in memory, but there's no chance reusing a vertex that was already cached.

2- Using gl(Multi)DrawElements. Because it uses indices, the VBO can be twice as small, but requires the use of vertex in a non sequential order. It also requires to read the indices before the vertex can be processed.

I see advantages and desadvantages on both methods. If we only consider performance, which one would be the fastest, and why?

1- Using gl(Multi)DrawArrays. Each point needs to be in the VBO twice because all vertex are used in sequential order, so it need to be there in each row using this vertex. It has the advantage of not jumping back and forth in memory, but there's no chance reusing a vertex that was already cached.

2- Using gl(Multi)DrawElements. Because it uses indices, the VBO can be twice as small, but requires the use of vertex in a non sequential order. It also requires to read the indices before the vertex can be processed.

I see advantages and desadvantages on both methods. If we only consider performance, which one would be the fastest, and why?