Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Aug 2012
Offline Last Active Apr 30 2016 01:50 AM

Posts I've Made

In Topic: Signed Distance Field Text Rendering: some questions

21 February 2016 - 08:26 AM

Thanks for that, xycsoscyx.

But it occurs, that if I use alpha testing and discard it, the smooth outline of signed distance field won't be smooth anymore, due to the fact, that the smoothness (like antialiasing) relies on the alpha fading.

Any other ideas?

In Topic: Signed Distance Field Text Rendering: some questions

18 February 2016 - 02:28 PM

Helloy xycsoscyx,


that's a point I've forgot to mention:

since I'm using OpenGL 3.3 Core, I can't use alpha testing by using glEnable(GL_ALPHA) and glAlphaFunc(...).

Is there some other way for that?

In Topic: Signed Distance Field Text Rendering: some questions

17 February 2016 - 11:01 AM

Hello Stainless,


that doesn't changed anything and wasn't a problem. smile.png


Anyway, two of the three questions aren't answered by now. wink.png

In Topic: Signed Distance Field Text Rendering: some questions

15 February 2016 - 02:05 PM

Hello C0lumbo,


thanks for replying. smile.png




  • I advance the cursor on the x-axis with the value of "xAdvance" (should be self-explanatory), but the space between two characters seems to be wrong (see screenshots). How can I fix this?

When you create signed distance field fonts, there's an extra amount of fuzziness around each character. It looks like in the hiero gui it's defined as 'spread' and you need to add an amount of padding to match the spread value. You don't mention that you're setting spread or padding in your config file, so I presume it's just taking a default value. Basically, you need to remove whatever spread/padding value that's being added from the xadvance to sort out the spacing.

Thanks for that. If I substract the spread from xAdvance it seems to be alright.

Anyway, sometimes it looks not so perfect, but I think, this is due to no kerning yet.

Any idea on how to implement it? I've got the data for a simple alphabet (something around 1111 kerning values), but don't know how to iterate it fast enough on a per character basis.




  • It occurs that the visual font thickness depends on the background color (see screenshots, in the upper one, the font seems to be clearly thicker). Why does it happen? (Due to alpha?)  And how can I prevent this behaviour?


I think that might just be an optical illusion. Some sort of drop shadow (easily implemented by rendering a dark, offset version of the text before the light text), or an outline/outer glow (best implemented in the fragment shader - it's one of the strengths of SDFs) would probably sort it out.

Unfortunately it is no illusion. rolleyes.gif

Here some screenshot, zoomed in a little bit:



It is the same font with the same size but without a different color in the background.

Why does it occur? Is my fragment shader wrong?


Thanks and a good evening,


In Topic: Atmospheric Scattering

25 November 2015 - 07:28 AM

However, keep in mind that he avoided the lookup table by effectively ignoring the other 2 dimensions addressed by Bruneton's 4D lookup table, and heavily quantized the remaining axes, so there is a noticeable reduction in accuracy and fidelity.


Okay, yeah, I think I will stick to Bruneton's implementation for a while. But it's quite heavy. Any tipps/tricks for this? :)