Is there a better method than triangle strip..?

I am trying to create a cloth. I have particles at a separation distance D to each other, along the row and columns, and I then create triangle strips to create a lattice of them. So for example I have a cloth of 200x200 pixels with a particle at (0, 0) and then at (0, 5) and so on…

My question is… is there any other less processor costly method of creating this cloth? I seen a website talk about some ‘max area’ technique which I can’t post a link to ( called Triangulation on humus) but I wished for something like a tutorial to do that or something which involves code or an actual research paper.

The angle of attack here is to minimize the number of triangles that needs to be drawn. That’s a perfect way ‘if:’

  1. all points lie on the same plane.
  2. you have a regular poygon that you up front know well enough to know ‘where’ you pick say the central triangle.

These constraints preclude your use of it on the cloth-surface. I can device an approach if you have a well-behaved polygon, but that’s somewhat off topic.
As far as I recall … if you use an index-buffer and draw_elements(), then you can draw your cloth with few calls only limited on the index type-size you use. You can add ‘breaks’ in the index-data [see provoking vertex] for restarting on a new strip-line. Since it’s the CPU side that usually lacks behind the GPU, it hardly cannot get better than what you’ve got.

you could take on finding coherent triangle-faces that approximates to reside on the same plane. I havn’t been there yet, but, as a triangulation-approach, it will induce complexity in preparing your drawing.

correction: provoking vertex should be glPrimitiveRestartIndex(index)

When rendering a grid, rendering row-by-row (or column-by-column) isn’t necessarily the most efficient approach if the number of rows/columns is large. The main issue is that you want all of the vertices for one strip to fit into the cache so that when it comes to drawing the next strip, the vertices which are shared between the two strips are still in the cache. If the strip is too long to allow that, you should “strip mine”, rendering the first N triangles on the first row, then the first N triangles on the second row, until you reach the bottom of the grid, then render the second N triangles on each row, and so on. So basically a triple-nested loop like “for (x_major) { for (y) { for (x_minor) …”. That will minimise the number of vertex shader invocations.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.