freetype-gl icon indicating copy to clipboard operation
freetype-gl copied to clipboard

Imporving SDF sharp corners smoothing issue

Open sasmaster opened this issue 10 years ago • 14 comments

Hi Man.I have just stumbled upon this blogpost:

http://lambdacube3d.wordpress.com/2014/11/12/playing-around-with-font-rendering/

which apparently solves the problem of sharp edge smoothing effect caused by SDF .

sasmaster avatar Dec 08 '14 14:12 sasmaster

Very interesting and nice results. Is there any implementation around ?

rougier avatar Dec 09 '14 02:12 rougier

I suppose what he has in that's blog post is all there is. On Dec 9, 2014 4:52 AM, "Nicolas P. Rougier" [email protected] wrote:

Very interesting and nice results. Is there any implementation around ?

— Reply to this email directly or view it on GitHub https://github.com/rougier/freetype-gl/issues/46#issuecomment-66227189.

sasmaster avatar Dec 09 '14 14:12 sasmaster

What about this? http://forum.libcinder.org/#Topic/23286000001127007

jyapayne avatar Dec 14 '14 07:12 jyapayne

I think they are using "regular" distance fields or I missed a point.

rougier avatar Dec 14 '14 07:12 rougier

The title clearly says "signed". But maybe it's a misprint. Edit: Nevermind, I misunderstood your original post. Carry on.

jyapayne avatar Dec 14 '14 08:12 jyapayne

All distance-field based text rendering approaches use the "signed" distance field. That part is not the question. Whether you use a sampling of the SDF or a less destructive representation is the key differentiating factor.

behdad avatar Dec 14 '14 08:12 behdad

Is there are reason to close this issue yet?

adrianbroher avatar Dec 22 '15 15:12 adrianbroher

Well not really, but I was cleaning all the issues...

I've looked at the sharp corners techniques and while the rendering is nice, there is still a number of problem to be solved.

rougier avatar Dec 22 '15 15:12 rougier

I suggest you to check with the author of nanovg. I recall we discussed that issue on Twitter and he said he was going to take care if it. On Dec 22, 2015 5:54 PM, "Nicolas P. Rougier" [email protected] wrote:

Well not really, but I was cleaning all the issues...

I've looked at the sharp corners techniques and while the rendering is nice, there is still a number of problem to be solved.

— Reply to this email directly or view it on GitHub https://github.com/rougier/freetype-gl/issues/46#issuecomment-166654828.

sasmaster avatar Dec 22 '15 16:12 sasmaster

Oh great, do you have a pointer on that discussion ? From the LamdaCube3D blog post comments, it seems the author is also looking to improve the technique but there is no pointer.

For the record: https://github.com/memononen/nanovg

rougier avatar Dec 22 '15 16:12 rougier

Wow, it was quite a long tine ago. Send him a message via githab or Twitter. On Dec 22, 2015 6:54 PM, "Nicolas P. Rougier" [email protected] wrote:

Oh great, do you have a pointer on that discussion ? From LamdaCube3D http://lambdacube3d.wordpress.com/2014/11/12/playing-around-with-font-rendering/ blog post comments, it seems the author is also looking to improve the technique but there is no pointer.

For the record: https://github.com/memononen/nanovg

— Reply to this email directly or view it on GitHub https://github.com/rougier/freetype-gl/issues/46#issuecomment-166672270.

sasmaster avatar Dec 22 '15 16:12 sasmaster

Just read: http://wdobbie.com/post/gpu-text-rendering-with-vector-textures/

Might be worth a C translation, any volunteer ?

rougier avatar Jan 02 '16 15:01 rougier

@rougier I can't find any convertor source codes. :(

bagobor avatar Jan 03 '16 12:01 bagobor

Yes, we need a human converter... :smile:

Shader source are available: http://wdobbie.com/pdf/font.frag http://wdobbie.com/pdf/web.vert

But the actual font transform is not (from answer on my comment)

rougier avatar Jan 03 '16 12:01 rougier