Author Topic: MakePixelPerfect() Making My Labels Blocky (Point Filtering)  (Read 7995 times)

aikitect

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 27
    • View Profile
I previously searched the forums and found the following criteria for pixel-perfect fonts in UILabels.  Here's what was said:

Your UI is 2D.
You are using UIAnchor with "half-pixel offset" checked.
Scales of all objects leading up to your labels are (1, 1, 1), excluding UIRoot.
Positions of all objects leading up to your labels use integer numbers: ie (1, 2, 3) instead of (1.23, 2.34, 3.45).
None of the objects leading up to your labels have been rotated.
Your actual label is pixel-perfect (Make Pixel Perfect button).

I have double-checked and triple-checked all these attributes, but some of my fonts are fine, some are blocky, and some are super blocky.  I am using Point Filtering at the moment, and I have three different UIFonts that are created from different sizes in BMGlyph.  The font that works fine is size 36 from BMGlyph, and the ones that don't are size 28 and size 48.  Why am I getting blocky fonts and labels if they're supposed to be pixel-perfect?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #1 on: June 10, 2013, 02:47:54 AM »
Picture would help. Select the UIRoot and hit Alt+Shift+P.

aikitect

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #2 on: June 10, 2013, 10:41:02 AM »
Screenshot is attached.

Zapgun

  • Guest
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #3 on: June 10, 2013, 11:25:13 AM »
These look like compression artifacts in your artwork.. did you check to make sure your atlas isn't being compressed?

aikitect

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #4 on: June 10, 2013, 02:41:32 PM »
They are set to Automatic Truecolor.  What should they be?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #5 on: June 10, 2013, 02:44:02 PM »
Truecolor is fine, assuming your atlas texture is set to that.

Why did you go with point filtering anyway, and have you tried offsetting the labels by a half-pixel to see if that changes anything? Just looking at the screenshot, the labels simply look like they were enlarged or shrunk -- and don't seem pixel perfect at all.

aikitect

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #6 on: June 11, 2013, 10:14:12 AM »
Are there any settings that I need in UI Root to make PixelPerfect work?  Like scaling size?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #7 on: June 11, 2013, 03:39:35 PM »
Its scaling style should be set to pixel perfect, and that's it. As I mentioned you can force the entire UI to be pixel perfect after the fact by selecting the root and ALT+SHIFT+P (or NGUI menu -> Make Pixel Perfect).

Jenzo

  • Guest
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #8 on: June 12, 2013, 05:13:37 AM »
I have experienced this too. One thing I tried which helped me was to blur the alpha on the text texture. Keep it as a GUI texture type with truecolor and tri filter. If you use a lot of different sizes on the text I guess it will be best to use Advanced and use Mipmaps to soften out the jagged lines.

cheers

aikitect

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: MakePixelPerfect() Making My Labels Blocky (Point Filtering)
« Reply #9 on: June 12, 2013, 02:37:09 PM »
I ended up fixing this by disabling mip-mapping on the textures and improving Unity's Quality Settings to Best.