Polyline sharp angle issue
Hi Freya, thanks for the great asset.
I have been using Polyline to create a pen tool and it works great, however I have noticed a bug when you create a sharp angle between consecutive points. I have attached a gif showing the issue:
And here are my component settings:
I would like to use the Rounded join type because it looks great as a pen, but the issue doesn't seem to happen on simple joins.
Thanks heaps,
Nick
yeah, all of this is complicated for a whole host of reasons, to mention some:
The way it behaves right now (and the reason it gets weird in certain edge cases), is because I let go of point 7 to enable point 4, 5 and 6. Drawing each line segment separately and overlapping them fixes the specific case of round joins with an opaque blend mode, and with anti-aliasing off, but it doesn't fix miter or bevel joins since they still need to be clipped one way or another. It will double up anti-aliasing when opaque but alpha blended with overlaps, and when using partial transparency, the overlap will overdraw the joins
The ideal solution in terms of quality would involve a whole screen-sized render target on a per-polyline basis, where it draws the shape mask and depth into a buffer, and then renders into your scene, at, wherever is ideal in whatever render pipeline you're using. but this is, expensive, and time consuming to get right across all the platforms and render pipelines people might use.
I have ideas for how to get closer to a solution here, along with a general overhaul of polylines to support things like dashes, but it does involve limiting platforms to those who support StructuredBuffer, which means it has to support compute shaders
so yeah idk! There's no ideal solution, I think it's just a matter of picking which drawback to be ok with, and this depends on your use case, and with all my users, I have all use cases, and whatever solution I pick will be bad for some of those use cases ;-;