I was just wondering if anyone could shed any light on this issue. Obviously when you scale 2d art it will not look as good as the original. We have a sprite (using SM2) that is 200x200 and made pixel perfect for 960x640 resolution. When this is run on a 480x320 device that sprite displays in the scaled down size so it fits exactly like it should, but the quality is very bad. But if we scale down this image to 100x100 in photoshop for example and then use it pixel perfect for 480x320 it looks so much better.
So the question is, why is the quality so much worse when scaling in Unity instead of Photoshop. Is it a performance thing? Does Photoshop have much better algorithms for this (it is a professional photo software after all)? Any other reason? Maybe i don’t know how to work it properly.
For all these GUI Images toggle Mipmaps of in case they are on.
Usually those textures have transparency this doesn´t look good compressed. So use 32bit uncompressed. (or 24bit if there is no alpha or even 16 bit if you have no gradients in there to save memory)
Consider to have two sets of graphics. One for Retina devices/ipad and one for the older ones. Load those depending on the device the app is running on. This way, there is no scaling and older devices save memory.
You said you use SM2. While i did never used that (But Guimanager and NGUI) i bet they have information on this in their docs. If not i bet people asked similar questions on this in the respective Forums here already.
For performance sake, don´t use a lot of single GUI textures. Combine them in an Atlas. But as you use SM2 i bet you did already.
Wether you use Photoshop or something else is irrelevant. In the end you should see exactly whats painted in your texture.
Mipmaps are off everywhere.
All textures are 32bit uncompressed and combined in an atlas by SM2.
For the sprites that look the worst compared to the original we are using two sets depending on the device.
It really seems to me that when Unity shows a 200x200 texture as 100x100 it doesn’t use a good scaling algorithm. Since i don’t have any deep knowledge about this i can’t really say, but since the problem seems to be when Unity is scaling down the texture instead of for example photoshop or any other graphics software, that’s the conclusion i end up with.
I am just trying to find out if there is nothing that can be done to fix this except for making double assets. If any Unity employee or someone that knows how the scaling works could clarify the details, that would be much appreciated.
There’s not much you can do. Photoshop gives you a 5 different methods of interpolation for reducing image size.
It best just to make two sets of graphics assets for two reasons:
The smaller images look better on the older 480 x 320 devices,
the smaller images use less memory on older devices, as the half size image is 1/4 the size and uses 1/4 of the RAM.
Create a duplicate of all the images into another folder, and use Photoshop’s Droplets to let it rescale all the copies for you, using Nearest Neighbor.
The add changes to scripts to switch to the lower rez art on devices with a screen width of 480 or screen height of 480 (depending on which orientation the app is)
Is the Textures Filtering mode set to Linear, or Bilinear. Linear is similar to Nearest Neighbour, with no interpolation, which can keep it looking crisp, but really bad when rotating said sprite. Bilinear will make it appear smoother, and will interpolate the resulting pixel so it can look smoother, but it will also give it a sort of fuzzy look.
Try to check both and see if one looks better for you than the other.
Thanks for the answers. I will try the different Texture Filtering modes and see if that can improve things a little.
Since we are about a week away from completing the game we would have to rebuild a lot of things and go through all the testing again to add another set of graphics. We’ll just have to think about it from the start in our next game.
hm,
usually you have your Gui grafics 1:1 pixelperfect. Unless you do some tweenanimations like pulse or so on them this shouldn´t be an issue at all. And even with tweenings, as long as you tween scale down, i was alsways very pleased with the results.
Could you attach some screenshots with a: the desired grafic and b : what you see and dislike? You can grap shots from the device with holding the home Button and the whateveritsname is small button at the border for 1 sec. Or you can use scripting to do so.
I tried the different Texture modes. Point, Bilinear and Trilinear. Point was by far the worst, Bilinear and Trilinear i couldn’t really tell a difference, and according to the docs it only make a difference if using mipmaps. I was hopeful about this one, but didn’t seem to help i’m afraid.
Here are two images. The first is the example texture in pixel perfect. The second is taken from the unity game window when running a scene. The picture to the left in that image is when the source texture is the one in the first picture, and the image to the right is when the source texture is taken from the original and scaled down in photoshop before using it in unity. I hope i could explain so it was understandable.
Well i wouldnt say it looks toooooo bad… I just has problems with the white outline, becomming to small. How about making that either lorger or drop at all.
Besides this, Pixelperfect usually means that you dont scale something at all.
So either you create an extra atlas for lowres screens… or i don´t know.
It looks much worse than the right one i think. So i’m just wondering why we can’t get the looks of the right one when Unity does the texture scaling instead of an image application?
The only reason i can think of would be for performance reasons, but i’m just guessing. Maybe i can just email unity support. They should have an explanation.
Because Unity3D as every 3D engines does bilinear filtering and you’re used to photoshop’s bicubic resampling quality. The transition from bilinear to bicubic does indeed a world of difference for an artist. It’s something you’ll have to learn to live with : resample your assets in photoshop or cope with the blurry aspect.
You’ll also soon discover that EVEN if you resample your assets you’ll still have a blurry aspect whenever you scale, rotate or even place a texture at non integer coordinates. That’s how it works, sorry ^^
Awsome Krobill. Thank you very much for providing an answer on how it works. That’s all i’m looking for, then i know how it works and will deal with the limitations accordingly.