Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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.

share|improve this answer
add comment

Your Answer

 
discard

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.