- Home /
Pixel art appears...pixellated?
Hey guys,
I'm having a bit of an odd problem. I've got a sprite sheet that I've imported into Unity with dimensions of 32 x 160. For some reason, no matter what I do, it appears pixellated, as if it's too small for Unity to handle. I've tried unselecting Mip maps, trying every max resolution from 32 to 4096, and yes - the color is set to Truecolor and filter mode is point. The material is set to transparent - diffuse, though I've tried a couple of different types. Nothing!
What's even more odd - I've got another sprite sheet with similarly small dimensions (228 x 256). It's a tad bigger because there are more animations, but the character's size in relation to pixel size is the same. This texture was created in RagePixel, but I did a side-by-side comparison by utilizing only the .PNG that Ragepixel creates and it works perfectly! Am I missing something here?
I've included a picture of what the character should look like, and how Unity interprets it. Any advice or wisdom is greatly appreciated.
Thanks in advance! -Clopay
You really need your textures to be in Power of 2 sizes (both dimensions) then these effects should vanish.
Thanks for the response, whydoidoit! Are you positive about that? I've had prior experiences where my sprite sheets weren't anywhere near power of 2 sizes, (including the second sprite sheet I make mention of) and have worked fine. I'll try it out, but I feel it may be another problem.
Well there's an option to specify a texture doesn't have a power of 2 size - but it's not a good idea to use it for performance reasons. The texture will be stretched to the nearest power of 2 size (and possibly made square) - if you click on your texture in the project view in Unity what size does it say it has?
You're right - it does say 32x128, which means it's been squashed from its original size. That's odd, as I've never had this problem before. So there's no way to import a texture and have it function properly unless it's dimensions are a power of 2? I wonder why I haven't had this happen before and it's just appearing now...
You probably just didn't notice :S
It's to make the graphics card transfers snappy... That's why atlasing is so important for 2D games...
Answer by Eric5h5 · Jan 09, 2013 at 06:35 AM
Change the "Non Power of 2" setting to none.
Eric5h5 - thanks for the advice! However, I did try that to no avail :/
Did you click "apply?" Because then it won't say 32x128 anymore.
I did select apply, and it reverts to its original 32x160 dimension; however, it's still a bit skewed. It's a tad more visible, but there is still a gray transparent layer around the edges it seems.
What texture filtering do you use? For pixel-perfect things you should use "point". Just play around with the settings. There is never a general way to do things, it depends on if your image is streched by an odd value (not a multiple of the original size) and how the texture is displayed in general. I guess it's going to be a 2D game?
Bunny83 - it's going to be a 2.5D game with animated sprites. I've tried just about every combination of texture settings I can, and yes, the filter is set to point. What's odd is that I've imported other textures (also not power of 2 dimensions) that work just fine, no pixelation or weird grey areas. I've also tried redoing the art from scratch to see if maybe I'd accidentally drawn transparent pixels or if it was in the way the .PNG was saved, but no luck there. This is completely baffling me.
Answer by MakeCodeNow · Feb 15, 2014 at 08:06 PM
The problem is that your texture filtering needs to be set to Point. Right now it's probably Bilinear, which will automatically "blur" the edges depending on the texture resolution vs screen res.
Answer by sockman · Jun 26, 2015 at 03:44 AM
Go into an image editor and resize it there. Use something like gimp, and when resizing it set interpolation/antialiasing to 0.