Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to render a 2-dimensional geometric path consisting of Bézier curves and straight lines. Paths can be concave.

What is the most efficient way to draw this using modern OpenGL? Can I do this with a vertex shader? How should I store the path segments?

share|improve this question
The most straightforward thing to do is to tesselate the path to triangles on the CPU - which isn't trivial, but I assume there are libraries and such to do it - and then render the triangles normally with OpenGL. – Nathan Reed Jan 24 '13 at 21:48

The easiest way is probably to use the NV_path_rendering extension:

If that won't work for you, you're going to essentially have to implement at least part of the functionality. The good news is that NV_path_rendering shows that it's possible; the bad news is that it's probably going to be a lot of effort, depending on your requirements.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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