View Full Version : GL_TRINAGLES vs GL_TRIANGLE_STRIP
12-14-2000, 12:29 AM
I wonder if there is some performance reason using one of these primitives instead of the other. Or is it just more comfortable using strips?
12-14-2000, 04:53 AM
The reason why one should use strips (and fans) instead of other primitives is that each prim decl take some init time, I'm not talking about the vertex/tex/normal decl but the primitive type itself.
So suppose, for example, we want to display a 100 faces mesh. With GL_TRIANGLES, we have 100 prims init, with GL_TRIANGLE_STRIP we have only one prim !!
Needless to say that kind of prim type you'd better use :)
This is important since there is a relation between the number of prims you declare and the number of vertices(texcoords/normals) you can actually send to the GPU : the more you declare prims the less you can send vertices....
Make some tests.
Can someone tell me if i'm wrong ??
Although it is true that a pair of glBegin/glEnd takes some time, there is another advantage of Strips over normal Triangles.
Let's say you need to draw a strip that contains 10 triangles. If you use GL_TRIANGLES, you will call 30 times glVertex (10 triangles * 3 vertices). If you use GL_TRIANGLE_STRIP, you will call it only 12 times (3 times for the first triangle and then only 1 time for each of the other triangles !).
As you see, you save a lot of time using strips !!!
Now the thing is that you need to be able to find these strips when you are given only a set of unorganized triangles ! But that's another problem...
As a hint, I have an ASE file that shows a mini-submarine (found on 3D cafe I think...).
If I don't use strips, the model runs at 13FPS. When stripping the model, it runs at 45FPS !!!!!
You should use strips whenever you can !
[This message has been edited by Eric (edited 12-14-2000).]
12-14-2000, 05:17 AM
Thank You both ...My thought was that You never know, what the driver/ the card will do with strips. Maybe they are converted to seperate triangles before reaching the GPU. But if You get better fps - ok! That's it
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.