I have a problem with textures in Unity 2D project. Everything is blurred, no matter what I do, to prevent that.
It’s a problem with filter modes in Unity, because there is no any good filter mode, suitable for 2d game.
The only advice I found on the internet is to set point filter, but it’s good only for textures without transparency.
I use “power of 2” size textures, but it doesn’t do anything. The quality in XNA and Direct 9 is much better.
To give you a proof, I attach an image, where you can see the problem which I described here.
As you can see bilinear is very blurred, point also don’t provide good quality.
Is there any way to use in Unity 2D textures without annoying blur?
Will be thankfull if someone from Unity team tell more about this case.
Below I attach 2 screenshots (one is zoomed) from orginal Unity 2D demo project. As you can see the same texture in Unity looks worse than orginal image, because is blurred. This effect is much easier to notice if you use a very detailed textures.
Now I would like to show you a better example, with more detailed textures. It’s really easy to see the difference.
It means that I can’t do good looking game in Unity, without using sharpening filters.
However it requires Unity Pro, but why should I use sharpening if it must looks good without any tricks.
This project is set to 1280x720 resolution, so you should run it in widnow mode (in 1280x720). No matter if I use “power of 2” size textures or not, image is always blurred.
Additionally I attach images to compare and project settings.
Original texture:
I’m hoping 4.5 will fix these issues. We had multiple bugs in 4.3 which might be contributing to what you’re seeing. One is that the mesh generated for the sprites has sub-pixel errors. Try working around this by setting mesh type to Full Rect - see advanced texture importer mode.
Hmm… I downloaded your project and ran it. The only change I made was to the screen size, it was set at 800x600, I changed it to 1280x720 (so the image wouldn’t be scaled.)
It came out identical. No difference at all (well, a very tiny color variance, but no blurring). Here:
Pixel snap works perfectly with sprites-default shader. However it didn’t work with sprites-diffuse, textures still were blurred.
In my opinion it’s problem with one additional pixel line, that Unity generates on left and top edge of the screen.
This pink color is a background, that shouldn’t be visible. If pixel snap is ON, pink lines disappear.
These lines make problem with bilinear filtering. I made one little improvement to Sprite-diffuse shader and
now my textures in Unity looks perfectly, the same as orginal textures. I tested it on Windows, Web Player and Android.
#if defined(PIXELSNAP_ON) !defined(SHADER_API_FLASH)
//v.vertex = UnityPixelSnap (v.vertex);
v.vertex.x -= 0.005f; // my improvement
v.vertex.y += 0.005f; // my improvement
#endif
Don’t know if it works on other platform.
I hope in 4.5 version it will be corrected, and no others tricks will be needed.
Thanks all for help.