6

I'm developing with OpenGL 4.1 and have good understanding of the modern pipeline. I was thinking on doing it with GL_LINE_LOOP for each face, but I think this will require several draw calls which certainly is not optimal. What could be a better approach?

BRabbit27
  • 969
  • 1
  • 10
  • 21

1 Answers1

5

Things like that are usually done using an index buffer. The idea is that you have you have two buffers: One for all the vertices and one that determines the topology of what to draw. Then you can draw all the lines at once with a single glDrawElements call, using GL_LINES as mode.

Wumpf
  • 853
  • 7
  • 15