Advertisement

how to draw multiple line strips in one draw call?

Started by August 08, 2018 01:32 PM
1 comment, last by Tessellator 6 years, 5 months ago

I have a number of line strips that I need to draw and I was hoping I could group them all together into a single draw call in OpenGL.  Is there a way to do this?  With triangle strips, I can add degenerate triangles between each strip and have them all drawn together in one draw call.  Is there a trick to do the same thing with line strips?

A couple random ideas:

1) If you're using indices check out glPrimitiveRestartIndex to see if that'll do it (I've only just noticed that functionality exists in GL!)

2) I remember reading/watching the presentation about Ghost Recon Wildlands and I think they clip bits of their terrain out for tunnels etc by setting a vertex position to inf or NaN (i.e. some invalid float value) - any triangle using an invalid vertex would be rejected completely. Although non-standard it apparently worked on all HW they tested; perhaps it'll work similarly for line segments? 

T

This topic is closed to new replies.

Advertisement