3
\$\begingroup\$

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?

\$\endgroup\$
1
  • \$\begingroup\$ 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. \$\endgroup\$ Jan 24, 2013 at 21:48

1 Answer 1

3
\$\begingroup\$

The easiest way is probably to use the NV_path_rendering extension: https://developer.nvidia.com/nv-path-rendering

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .