Hey are you aware of an exact "tapered quadratic bezier" sdf formulation in 2D? (trying to draw some clean curves :)
I found this shadertoy.com/view/ldj3Wh, but looks like the trick of 'shrink radius based on t' isn't exact, and produces artifacts at the bends?
Conversation
Replying to
Yes, it will produce artifacts in high curvature areas or strong tapering.
Maybe you can have two curves, one for each side of the stroke? Can use this as a starting point: shadertoy.com/view/MlKcDD
But still, seems to me thickening curves (SDF or polys) is a difficult problem
3
2
6
Replying to
1
Yeah I tried the shrink radius on t and it was indeed buggy. I guess you have to write in your exact radius as a function of t formula and probably solve a slightly higher order polynomial?
1
1
Yep I think if spheres-swept-along-a-curve is the goal then you'd want a distance field to a "canal surface" (en.wikipedia.org/wiki/Channel_s), but constructing this distance field directly seems difficult.
3
5
Polynomial degree gets pretty high though, e.g. I think quadratic curve with linear radius needs solution to degree 6 polynomial (eqn 7 in that paper).
Yup, what's everybody's favourite root solver in a shader these days? 😅
1



