As some of you may know drawing line segments between sets of points is really difficult especially when you want wide lines or variable widths.
Because I am looking to draw a few hundred of these line segments each frame I am having to go with the cheapest option to achieve a connected segment. So far this has meant that I am using a miter to join the two rectangles like so (described here)
The problem with this approach is that the extra length added by the miter is sometimes quite large especially in the case of acute angles and I would like to have rounded corners where possible.
I believe it is a job for the fragment shader as I don't have enough processing resources to calculate more geometry.
Here is a diagram showing what might end up happening after the fragment function:
Purple represents the area between the two lines that ought to be kept; the rest should be removed.
Does anyone know a way to achieve this rounded rectangle in the fragment shader even though texture co-ords are pretty useless in a scenario where the shape is not a polygon.
I wish I was allowed to just draw the rounded circle over the disjointed
Remember, whatever it is it needs to be fast.