GL_TRIANGLE_STRIP to GL_PATCHES (as input of tesselator control shader)

Is there a fast way to call glDrawElements with GL_PATCHES while providing a ‘triangle strip’ list of indices ?

Right now I have to convert my triangle strip to triangles list because there is now way to tell the OpenGL Tesselator Control shader that my drawElements call is triangle strip list and not a triangle list.

Using

[ul]
[li]layout(vertices=3) out;[/li][li]layout(triangles, fractional_odd_spacing, ccw) in;[/li][li]glPatchParameteri( GL_PATCH_VERTICES, 3);[/li][li]glDrawElements(GL_PATCHES, …) with indices as an existing triangle stripped object.[/li][/ul]

Thanks

There is no GL_PATCH_STRIP, so I believe the easiest way to avoid duplicating your vertex data is to build an equivalent element list of { 0,1,2, 2,1,3, 2,3,4, 4,3,5… } for your strip.

I think you have missed the point of a patch. It is just a set of data - they are not triangles/lines or anything special. It is the shader that actually decides what the data represents. For example a patch vertex may define a sphere or a cylinder that is constructed in the tessellation stage or a set of vertices may be knots for a nurb surface.

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