Author Topic: Pixel Perfect Weirdness  (Read 2048 times)

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Pixel Perfect Weirdness
« on: July 26, 2012, 09:43:22 PM »
So I'm toying with different ideas for UI themes and, since I'm inspecting the screen closely, am noticing that some of my test menus just aren't doing their pixel perfect magic very well at all. (See attached image.)

Are there any caveats to making pixel perfect work correctly?  I tend to have a structure like this:

UIRoot -> UICamera -> UIAnchor -> OriginObject -> UIPanel ->UIsub-widgets

The "OriginObject" is just an empty GameObject I stick in the structure that has the correct origin for the panel that is a child of it.  This allows me to set the panel's transform position with something like Y = 1000 so that it is not on the screen while I'm working with other elements.  I have a script attached to each UIPanel that set the local position back to 0,0,0 on Awake.

So what I'm seeing is that the left-hand menu isn't pixel perfect (backdrop or icons or text) while the one on the right is.  What could be causing this?  Note that it looks like this both in the Editor and while the app is running.
« Last Edit: July 26, 2012, 09:45:07 PM by JRoch »

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Pixel Perfect Weirdness
« Reply #1 on: July 26, 2012, 09:49:39 PM »
Wups, I figured it out.  Turns out it's a bad idea to take your NGUI camera structure and translate it out 10000 units from the origin.  Doing so make the floating point math introduce precision errors that causes pixel perfect to fail to cope.