Chlumsky / msdfgen

Multi-channel signed distance field generator
MIT License
3.9k stars 404 forks source link

Default PxRange is 2, it cause a problem when I try to do outline effect. #139

Closed Chinayang1 closed 2 years ago

Chinayang1 commented 2 years ago

Default PxRange: outline_px2

PxRange 16: outline_px8

It's spent my a lot of time to realize this. The distance value on GPU fastly smooth from 0 to 1.0f. Compare distance is invalid to find outline.

pxRange_16_thinness And even on high pxRange, Thinness effect doesn't work for art font with different thinness of a letter.

Chlumsky commented 2 years ago

The default value of pxRange is not intended for drawing outlines but it is sufficient for basic rendering - that's why you can change it. As for the last "problem" with "different thinness" that's not something that can be solved with this (or any similar) software and was never claimed to be. All it provides is signed distance from the edge, not from the center.