The title of the Valve SIGGRAPH 2007 paper on signed distance fields (SDF) is important to pay attention to: "Improved Alpha-Tested Magnification of Vector Textures"...
-
Show this thread
-
"Improved" -- not perfect. It's an approximation and fails in many cases. "Alpha-tested" -- not multicolor, monochrome only. "Magnification" -- not minification. No point in using SDFs if you aren't going to magnify shapes.
3 replies 0 retweets 8 likesShow this thread -
I see a lot of use of SDF when it's either insufficient (e.g. detailed small text) or overkill (e.g. text rendered at a fixed size). Remember: SDF is not "how you render text on GPU". It's just improved alpha-tested magnification.
2 replies 0 retweets 9 likesShow this thread -
Replying to @pcwalton
SDFs have their niches. They work great when you need not-perfect-but-okay small text with frequent non axis aligned transforms (maps, etc. ). Hard to beat in simplicity/speed for that type of things if you ship the SDFs pre-generated. Granted it's not a general purpose solution
2 replies 0 retweets 1 like -
Replying to @nicalsilva
Is it really that much better than just rotating bitmaps? The differences shouldn't be great. BTW, I think that unless you're doing shadows and outlines SDFs are mostly isomorphic to bitmaps. i.e. you can convert a bitmap pixel to a distance value.
1 reply 0 retweets 0 likes -
Replying to @pcwalton
SDFs are less blurry than bitmaps when transformed. While they don't retain full smoothness/"pointiness" of the shape, they can do sharp edges. The difference is that you compute the aa on the real pixel grid after tranform rather than before and then resampling due to transform.
2 replies 0 retweets 0 likes -
Replying to @nicalsilva
Sure, but you can do that with regular antialiased bitmaps too. You just need to convert from pixel coverage to distance. It turns out that while not quite the same they’re highly correlated to within 5% (the formula is in WR actually, see distance_aa)
1 reply 0 retweets 0 likes -
Replying to @pcwalton
Interesting. I didn't think it would work that well. So maybe we shouldn't bother with rasterizing transformed text in screen space when there is no sub-px aa
1 reply 0 retweets 0 likes -
Replying to @nicalsilva
Well, it’s just a hypothesis. Needs to be tested. I think the characteristic “wiggly sides” of alpha-tested magnified bitmaps are actually small graphs of pixel coverage vs. distance.
1 reply 0 retweets 0 likes
Unfortunately the errors magnify when you do the conversion and you still get wiggly lines. :( Oh well.
-
-
Replying to @pcwalton @nicalsilva
BTW I’m pretty sure you can generate SDF very quickly if you have the appropriate rasterizer. It’s just that few people do it that way.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.