Bad / “blurry” pixel rendering of a 2d sprite

Hello,

I’m testing things in unity but I’ve run into this problem and i can’t solve it…
I have the following configuration:

Images of the problem:

As we can see in the problem images the pixels are blur or strange and i need the pixels not to be clipped or strange… i read that a possible solution to that is to create a script for Pixel Perfect but i can’t get it work… ¿Any suggestion? Thanks!!

Skype: iegor3

Hi there,

Achieving a pixel perfect look comes down to the cameras orthographic size, and the pixels per unit ratio.
The guys at Unity very recently (19 June) posted on the blog about this. Give it a thorough read. :slight_smile:
http://blogs.unity3d.com/2015/06/19/pixel-perfect-2d/

I use a pixel per unit of 10 on all my sprites, and set my Snap Settings to 0.1 and use Ctrl key to position stuff around.
(I make sure that none of my transform are at a position that has more than 1 decimal. So if I have 56.23 I set it to 56.2).

As for the orthographic size, as it says on the article. It depends on the resolution. For 1280x720 I use an orthographic size of 18. There are multiple values that work for every resolution, depending on the zoom level that you want. :slight_smile:

But remember that it will only be pixel perfect if you’re viewing it at that Resolution. You will want a script that changes the orthographic size depending on the Resolution of the screen if you want it to work for more resolutions. And also if your editor window is smaller, it will appear imperfect in the editor.

The reason that I use a pixel per unit value of 10 is because I have a moving camera and somehow it’s a magic number that the camera likes.

Hope this helps. :slight_smile:

3 Likes

Thanks for the reply! I will try to follow all you said.

I ran into the same problem today. It occurs when a large sprite with FitlerMode Point becomes too small. My solution was to simply make the sprite image smaller, however it was just a GUI frame image so probably not applicable in your case.

Thanks for the responses.

I tried to set the camera ortographic size to the right value and yes it appears to be pixel perfect but it’s too big.
Here an image:

The image of what i want:


I need to get the view as the image above but with a good view of the pixels.

Thanks!

Your game view is set to “Free Aspect”, which means it’s going to display at “whatever resolution it happens to be”. You’ll have to set it to your exact resolution - something like this image - to get rid of the various smoothing / filtering effects that are going on in the resolution conversion.

(click the “Free Aspect” button in the top left to change it; you can add a specific resolution such as 800x600 like I’ve done)

1 Like

This made it way better! I am still seeing that the pixels are weird though… Some lines are smaller or thicker than other… hmm any ideas?