- Home /
UI Image gets distorted
I'm trying to set up a UI using the new UI system on unity 4.6
I created a UI Image but when I added a PNG file (actually I tried using PSD, TIFF and got the same problam) my image gets distorted.
this happens only when I set the filter to "point", but when trying the other filters the image is really blurred... so "point" is the best option
I found out that changing the game resoloution can fix it, it happens only on 16:10, 16:9 and free aspect
here's what I'm talking about:
the one on the left is the original and the one on the right is in unity - you can see that the image gets distorted in the red circle.
Answer by HarshadK · Sep 09, 2014 at 02:05 PM
Check the Pixel Perfect checkbox for the canvas to which this image belongs.
Forgot to mention that I already tried doing that - it actually makes it even worse. the "cut" (in the red circle) continues even more than it is in the example I uploaded.
Answer by Itaros · Oct 26, 2014 at 08:42 PM
I have got the similar problem with my awesome gui.
There are two factors: sampling and pixel alignment.
Regarding sampling: if one texel is smaller or larger then physical pixel of a resolution it goes sampled which can give awkward artifacts. Make sure GUI is rendered on special pixel-perfect orthographic camera where 1 unit translates absolutely to 1 pixel.
Regarding alignment: on DX it is assumed pixel is in center of unit so you need to nudge the object by 0.5F on x and y axises. On OGL pixels start at unit edge and no coordinate manipulation required.
For example: DX-aligned pixel-perfect GUI on OGL device(Android)