Strip finding to pass to glDrawElements

Hi,

I have a UV texture mapped mesh, so I have shared vertices but sometimes the texture coordinates aren’t shared. I think that sending all the vertex info repeated in a call to glDrawArrays can be a waste of memory.

Although some vertices doesn’t share texture coordinates, there are in fact vertices that do it. I’m almost sure that there are known algorithms that are able to split the mesh in several strips whose polys do share that information, making the drawing as easy as calling glDrawElements as many times as the number of strips generated.

Do you know a better method than testing every vertex with all the others to see if they are contiguous and if this is true, seeing if they share the info? It would only happen once in the application, or these strips could even be calculated with an external tool program…

I hope it’s well explained :slight_smile:

Thank you!

tri strippers do this, they check vertex values for all attributes, including normals and colors if you have them. Anything attribute prevent sharing tris on a mesh and so they must all be tested.

Here is a decent tri stripper you can use for your purposes:

http://www.plunk.org/~grantham/public/actc/index.html