upvote
> Slug doesn't seem to support any of these, it is just "for a given point, am I in or am I out?", but it doesn't tell you by how much

It does give you an anti-aliased value between 0 and 1 that estimates how much of a pixel is being covered.

But this is a linear estimate based on horizontal and vertical distance to the Bezier curve. It does not look correct at long distances, which is why you shouldn't use it for outlines, drop shadows or the other cool things you can do with (M)SDF. A single pixel outline works fine but is not really legible with modern display resolutions (very thin lines).

For finding the minimum distance between a quadratic Bezier curve and a point would require solving a 3rd degree polynomial, where Slug's algorithm gets away with solving a quadratic equation per pixel. This is makes a big performance difference.

reply
Having a technique that optimizes solely for whole pixels seems relatively reasonable, given current hardware PPIs. Systems that want to handle grayscale could use a different technique for that.

That said, there are interesting effects other than grayscale antialiasing, and I wonder how well slug could handle things like outlines (useful for subtitles over video, to make them readable on any background).

reply
I don't follow, current hardware PPIs are generally low, while whole pixels work for high?
reply
> current hardware PPIs are generally low

Not especially, unless you're running something like a high-refresh-rate gaming monitor that's still 1080p or less.

On most current phones, laptops, and monitors, I would expect the difference between grayscale antialiasing and monochrome rendering to be hard to notice.

reply
> unless you're running something like a high-refresh-rate gaming monitor that's still 1080p or less.

Or HMDs. Upcoming high-resolution PICO Space Pro is said to be ~45 pixels/degree max. Versus ~50 ppd for a 1080p laptop. Formerly known as Project Swan, its September global release announcement was postponed until... unclear.

reply