# OpenGL are strips/fans faster for rendering or just data bandwidth

When we send data for drawing we can mark it as TRIANGLE_STRIP or TRIANGLE_FAN to reduce the number of vertices we have to specify. Now, does this actually improve the rendering speed on the graphics card, or does it merely reduce the amount of data that has to be sent to the card?

I'm using a very simple model. To construct it correctly I need multiple calls to glDrawArrays using TRIANGLE_STRIP. If I switch to using just GL_TRIANGLES I could have just one call to glDrawArrays. Is this type of apporach useful, or is the overhead of an the call to glDrawArrays low enouhg that it won't make a difference.

I will profile, but since I have only one card I don't know if my result will be indicative of the general case. (NOTE: I need to be ES2 compliant, so some of my options are limited).

• Use vertex indices. That allows the GPU to only run the vertex shader once for each shared vertex, even when using GL_TRIANGLES. Separate issue from your question, but related to your desire for performance. – Sean Middleditch Aug 13 '12 at 16:33

A single call to glDrawElements with GL_TRIANGLES should be the most optimal in the general case - have a read of https://web.archive.org/web/20130328101248/http://home.comcast.net/~tom_forsyth/blog.wiki.html#Strippers - strips are basically obsolete and have been for over a decade.

• This is a good point. – edA-qa mort-ora-y Aug 13 '12 at 11:10
• It's interesting that people link to that despite the faulty reasoning for his main point. Namely, he forgets that every triangle from a strip automatically reuses the last two vertices. So his reuse calculations for the strips are entirely wrong. His main thrust is right in that it's easier to build an optimized list than an optimized strip. But the idea that an optimized strip is not as efficient as an optimized list is simply incorrect. – Nicol Bolas Aug 13 '12 at 11:42
• A secondary point that's often ignored is that an indexed list can be used to concatenate multiple strips for hardware where primitive restart is unavailable. – Maximus Minimus Aug 13 '12 at 13:31
• The link is dead. – Tara Apr 19 '16 at 16:54
• @Tara you can use the "Wayback machine", here: web.archive.org/web/20130328101248/http://home.comcast.net/… – Gediminas Mar 10 at 18:47

In general, you should not be using glDrawArrays at all. If your model has repeated vertices, you'll get a lot more bang for your buck performance-wise from an index list. There, optimized strips or even triangles will be able to use the pre and post-T&L vertex caches. This means less memory fetching and less vertex shader execution.

• In this case I have a lot of repeated models. It does however appear the sentiment is for using indexes (this is my next avenue for exploration). – edA-qa mort-ora-y Aug 13 '12 at 11:12
• I don't see what repeated models have to do with anything. glDrawArrays doesn't make that any easier or harder than glDrawElements. – Nicol Bolas Aug 13 '12 at 11:43

A) If your model is simple then you most probably won't need to optimize at all (what's your specs in polycount, target machine etc. ?)

B) If the vertices in your model isn't changing (for example: a lamp post, a landscape, a human character in its bind-pose that the vertex shader will animate), use a VBO

VBO:s are very very fast as you just send your vertex data once at "level-startup".

• Experiments on my machine suggest that having one call to dlDrawArrays with a larger set of vertices is significantly faster than multiple calls. (NOTE: I'm just trying to push my system to the limit in my tests at the moment) – edA-qa mort-ora-y Aug 13 '12 at 9:54
• If bundling together polygons is faster, VBO:s might be the way to go. I had a terrain (32k triangles) with a fairly complicated shader (splatshader with 8 textures and a fairly complex lightning model), going from 'sending all vertices & triangles every frame' to VBO changed the framerate from ~200fps to 4500fps on a 8800GT... – Valmond Aug 13 '12 at 12:20