Search Unity

Rendering artefacts with TypeMyMusic font

Discussion in 'UGUI & TextMesh Pro' started by oscarlosu, Dec 3, 2018.

  1. oscarlosu

    oscarlosu

    Joined:
    Mar 4, 2015
    Posts:
    12
    renderingArtefacts.PNG

    I'm getting some rendering artefacts with a font I want to use to render music notes using TMP (see attached image)

    I generated the SDF font using the default settings for the TMP font asset creator. I've tried fiddling some of the settings, but I am a bit at a loss.

    Find repro project attached.

    Any advice @Stephan_B ?

    Thanks in advance.
     

    Attached Files:

  2. oscarlosu

    oscarlosu

    Joined:
    Mar 4, 2015
    Posts:
    12
    renderingArtefactsMarked.png

    I realised the artefacts are not as visible in the image as they are in some cases, so here is a version of the screencap with them marked in red.
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I was about to reply as I got notification of your new post.

    The white lines and how these behave as you adjust the position of the text object up or down is due to anti-aliasing. This is tricky as these are thin lines.

    The gap between lines can be tweaked in the Font Asset editor to adjust the X and Y Bearing and Advance.

    Let me play around with this...

    1. Switching to Linear Color space should help.
     
    oscarlosu likes this.
  4. oscarlosu

    oscarlosu

    Joined:
    Mar 4, 2015
    Posts:
    12
    Hi!
    Thanks for your answer @Stephan_B . I just tried tweaking the OX (is this what you called the X Bearing?) parameter in the font editor and that seemed to help a bit with the weird gaps between characters. Advance didn't seem to have an effect, though?
    I also tried switching to linear color space and that did seem to help some with the lines looking different depending on their position on the screen. However, trying it on our actual project, it drastically changed the look of all the other assets in the game, so that is probably not an option for us. Any other suggestions would be a great help.