Y'all want to see a cool shader?

https://www.shadertoy.com/view/dls3Wr

This is mashing up two ideas:

- @iquilezles@twitter.com's closed-form "signed distance to a quadratic Bézier curve" solver
- using winding number to determine inside/outside-ness

Putting these two ideas together, we can render a Bézier font from its raw control points, as a single (huge) closed-form math expression!

@mjk huh how do you get from an sdf to a winding contribution? And why do you need a winding number anyway--can't you just take the minimum under magnitude of all the distances?

@moonchild

Each quadratic contributes to the winding number based on whether we're inside or outside the quadratic (lines 180-185).

I encourage you to try taking the minimum under magnitude; I found that it didn't handle concave shapes correctly.

@mjk Here—quickly hacked up, and has some obvious robustness issues (which is to be expected with this kind of renderer), but otherwise appears to cope fine with the concave sections.

@moonchild

Here's an quick counter-counter example:

https://www.shadertoy.com/view/dls3WN

It's not robustness issues, it's the equivalent of z-fighting between the two curves when they have similar (absolute) magnitudes.