6
$\begingroup$

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?

$\endgroup$

1 Answer 1

5
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Amazing, just finished implementing it and Element Buffers are the way to go. $\endgroup$
    – BRabbit27
    Oct 28, 2015 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.