View Full Version : Wireframe and GL_TRIANGLE_STRIP

06-21-2011, 12:28 AM
I was wondering if there was a way to render wireframe differently for a gl_triangle_strip as not all the triangles are connected side by side I get this and it looks pretty messy when there are a lot of triangles.

I am using this line of code to draw:

glDrawElements(GL_TRIANGLE_STRIP, indexCount, GL_UNSIGNED_SHORT, indices)



Would it be possible to remove the line in the middle so that only whole triangles are rendered like in the GL_FILL?

Alfonse Reinheart
06-21-2011, 01:25 AM
Use primitive restart (http://www.opengl.org/wiki/Vertex_Specification#Primitive_Restart) instead of degenerate triangles to connect strips.

06-21-2011, 08:15 AM
It'd seem that is only supported from opengl 3.1 and later, which it seems isn't supported by my drivers/card. If there is no other method I guess the best solution would be to generate new indices?

Alfonse Reinheart
06-21-2011, 09:52 AM
It'd seem that is only supported from opengl 3.1 and later

NV_primitive_restart has been around for a long time. ATI only started supporting it in the HD days, but NVIDIA has had it since the GeForce FX era.

06-21-2011, 10:51 AM
The other method is to use GL_TRIANGLES.