# OpenGL Triangles, quads, or both?

This topic is 4452 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
Two triangles probably won't render faster than 1 quad, but one triangle strip will, AFAIK. Assuming your video card doesn't convert quads to triangles anyways, in which case it's a mute question.

If done right, you use the same number of vertices to render 1 triangle strip (of 2 triangles) as you do for a quad. As long as you draw the vertices in the right order (TL,BL,TR,BR for CCW), you can use the same vertex array to draw a quad or tristrip, and see if there's a speed difference for yourself.

Of course, all that's assuming you meant "converted to two triangles" literally, as in 2 seperate triangles of 3 vertices each, which is not the best way to do it. Rendering 2 seperate triangles would probably be slightly slower, for obvious reasons.

##### Share on other sites
Thanks for your reply. This brings me to a slightly off-topic question: I'm not an expert on sorting geometry, so does anyone know a good algorithm to convert geometry of single triangles to a triangle strip?

Edit: sorry, should've used Google ;). However, feel free to give your opinion about the best algorithms ;).

##### Share on other sites
Quote:
 Original post by Prgrmr@wrkTwo triangles probably won't render faster than 1 quad, but one triangle strip will, AFAIK.

1 quad == 1 triangle strip. There is no difference in speed

Quote:
 so does anyone know a good algorithm to convert geometry of single triangles to a triangle strip?

just use the nvidia tri-stripping library. Life's too short to worry about re-inventing an offline geometry processing technique..... ;)

In all honesty though, if your tri's are in indexed vertex buffers, then there is next to no difference in speed between a tri strip and a list of triangles. The only measurable difference in speed comes in transferring the indices to the graphics card. Tri-strips give the benefit of a smaller memory foot-print since they require fewer indices, but that's basically it. The computation required to render a set of tri's vs a tri-strip is the same.

The only times you will find strips outperforming lists is when you are not using indices to reference vertices (or for some reason you are using immediate mode openGL). At that point, tri-strips will require less vertices to be transformed on the GPU so will therefore be quicker. Otherwise, unless you are really short of ram, or are sending too much data across the bus to the GPU, they wont make any real difference.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633702
• Total Posts
3013448
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!