0
\$\begingroup\$

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)

Thanks

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

\$\endgroup\$
8
  • 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
    Commented Sep 24, 2015 at 16:22
  • \$\begingroup\$ @jhocking setting it to 1 doesn't do much help either \$\endgroup\$ Commented Sep 24, 2015 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
    Commented Sep 24, 2015 at 16:46
  • \$\begingroup\$ @jhocking added the main camera screenshot \$\endgroup\$ Commented Sep 24, 2015 at 16:49
  • \$\begingroup\$ Possibly related: blogs.unity3d.com/2015/06/19/pixel-perfect-2d \$\endgroup\$
    – fadden
    Commented Sep 24, 2015 at 17:00

3 Answers 3

1
\$\begingroup\$

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

\$\endgroup\$
8
  • \$\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\$ Commented Sep 24, 2015 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\$ Commented Sep 24, 2015 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
    Commented Sep 24, 2015 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\$ Commented Sep 24, 2015 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
    Commented Sep 24, 2015 at 18:00
0
\$\begingroup\$

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.

\$\endgroup\$
1
  • 4
    \$\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
    Commented May 25, 2016 at 10:40
0
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .