Search Unity

Pixel Perfect runtime

Discussion in 'UI Toolkit' started by Scorr, Aug 16, 2020.

  1. Scorr

    Scorr

    Joined:
    Jul 2, 2013
    Posts:
    73
    I am currently struggling with getting my text to show up pixel perfect at runtime.

    UI Builder:
    Runtime:

    Scaling setting does not matter, even with constant pixel size this happens. Also game window scaling is at 1:1, tested with different game window resolutions. Not sure what could be causing it.
     
  2. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    There are currently text rendering quality issues in runtime that will be fixed.

    The runtime currently uses an SDF rendering solution similar to TextMeshPro. We are aiming to achieve "pixel perfect" quality with the SDF-based solution. If you have a font that you can share, we could have a look to make sure it renders properly.
     
    Onigiri likes this.
  3. Scorr

    Scorr

    Joined:
    Jul 2, 2013
    Posts:
    73
    The font I'm using for testing is Munro: https://www.fontspace.com/munro-font-f14903

    The rendering mode in import settings is set to Hinted Raster. At 100% zoom the characters should be exactly 1 pixel thick as seen in first post.

    It's weird that it does work in UI Builder. It seems runtime does some extra scaling, regardless wether scaling is turned on, as even non-pixel perfect fonts are blurrier than in UI builder.
     
  4. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Thanks, we'll have a look.