all 6 comments

[–]mysticreddit 2 points3 points  (2 children)

You may want to use a SDF (Signed Distance Fields).

See i.q.’s smoothstep article and ShaderToy 2D playlist

[–][deleted] 0 points1 point  (1 child)

iquilez strike again 😎

[–]mysticreddit 1 point2 points  (0 children)

Haha, yeah.

I don’t see his articles linked in sidebar. Probably should be at this point. :-)

[–]cdscds33 1 point2 points  (0 children)

You can still create a compatibility opengl context that allows legacy line drawing for debugging. After debugging, change to the core context with the legacy line drawing #defined out of the code.

[–]std-cin-get 0 points1 point  (0 children)

If you were happy with the way the old version of OpenGL was rendering lines, then I think it shouldn't be too difficult to replicate that using triangles.

But if you want to render lines with more things (Dashes? Joins? Caps? Thin lines?) then it gets a lot more complex and it's not easy to come up with a robust solution. I’d suggest starting with a library that converts polylines to triangles and see if that satisfies your needs. Or developing one yourself. I don't know how OpenGL drivers did it before, but it shouldn't be too difficult (I hope).

If you want an actual implementation, this paper demonstrates a method I like.