so, I'm not sure what caused this, let image below do the explanation : enter image description here How to fix the overly blurred texture in unity? It's so frustrating, since I can't get it right, because when I tried it in LibGDX, the image looks good (Well, it's not exactly a same image, but similar).

They both screenshot from android device (Samsung Galaxy Note 3 Neo)


P.S. It's a pixel art

Edit, here's the screenshot of my relevant inspector window

enter image description here enter image description here enter image description here enter image description here

And here's the alpha ingame screenshot enter image description here

  • 2
    \$\begingroup\$ Are you sure scale .75 is a good idea? Typically you want to leave sprites at full size (ie. scale 1) in order to see exactly the image with no interpolation. \$\endgroup\$ – jhocking Sep 24 '15 at 16:22
  • \$\begingroup\$ @jhocking setting it to 1 doesn't do much help either \$\endgroup\$ – Moses Aprico Sep 24 '15 at 16:39
  • \$\begingroup\$ You showed the pixels-per-unit setting in one screenshot, but can we also see your camera settings? The camera needs to be correctly sized for a pixel-perfect display. basically what I explain here gamedev.stackexchange.com/questions/75376/… \$\endgroup\$ – jhocking Sep 24 '15 at 16:46
  • \$\begingroup\$ @jhocking added the main camera screenshot \$\endgroup\$ – Moses Aprico Sep 24 '15 at 16:49
  • \$\begingroup\$ Possibly related: blogs.unity3d.com/2015/06/19/pixel-perfect-2d \$\endgroup\$ – fadden Sep 24 '15 at 17:00

In order to get pixel-perfect 2D graphics in Unity, you need to correctly set the size of the camera. I explain it in this other question:

Why does Unity in 2d mode employ scaling and the default othographic size the way it does?

Long story short, set the camera to Orthographic (which you've done) and then set the Size to:

size of your screen / pixels-per-unit setting of your images / 2

  • \$\begingroup\$ gonna try it first, do not expect me to quickly accept it. But as soon as I make it work, I'll accept this ASAP. Thanks! \$\endgroup\$ – Moses Aprico Sep 24 '15 at 17:19
  • \$\begingroup\$ Btw, say my device testing screen height (using unity remote) is 1280 (my game is portrait). So then, 1280 / 100 / 2 = 6.4. But the image is still rendered blurred. Why? \$\endgroup\$ – Moses Aprico Sep 24 '15 at 17:40
  • \$\begingroup\$ Your pixels-per-unit is set to 50, not the default 100. Also you scaled the image to .75; I would recommend leave the scale at 1. \$\endgroup\$ – jhocking Sep 24 '15 at 17:43
  • \$\begingroup\$ I see, fixed. But yet still slightly blurred compared to the original image. So, the recommended way to resize the sprite is via external image editor (Photoshop etc), and not via unity scale? \$\endgroup\$ – Moses Aprico Sep 24 '15 at 17:54
  • \$\begingroup\$ yes. and if it's still blurry, perhaps now you should try vitorino's suggestion about filter mode? That didn't work by itself, but it may help now that the camera is correctly sized. \$\endgroup\$ – jhocking Sep 24 '15 at 18:00

This is weird tho. The unity remote view is blurred, while the built version is not. I think it's because the unity editor resolution is somehow forced to fit the window size (even though I've defined 1280x720 manually, but still forced down to around 400ish pixel), because, when I build the apk version and installed it on my device, the picture no longer blurred. Not sure why. (I tried with a new clean project btw.). But I think the problem is not on the camera ortho size.

  • 3
    \$\begingroup\$ You should have said that you are using unity remote. let me explain how unity remote works. Its litteraly captures the game screen from the editor and sends a compressed stream to the device. Then it handles inputs from the device and sends them to the editor. The quality of the graphics is always going to be blurred when using unity remote. you can refer to this \$\endgroup\$ – Uri Popov May 25 '16 at 10:40

I don't see an obvious problem in the settings you show, but I have seen a similar blurring effect with unusually wide sprite sheets. The program Aseprite likes to export in one long sheet, like a film strip, and that is where I've seen it happen. When this has occurred for me, changing the Max size on the sprite import settings did not fix the problem. I had to edit my sprite sheet and make it more grid based.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.