Unity UI image + mask has jaggies

Hi there! The new layout for GUI in Unity is amazing BUT, as I was playing around with it, I’ve found out that one of my canvas’ images is rendered with jaggies and I know it shouldn’t have them.

I’ve imported it with maximum settings and the image itself is pretty large, which is why I wasn’t expecting this issue.
Thing is, the image is jagged even if I scale it to lower W/H in the Canvas.

Since I’m not familiar with these problems and I’ve already checked the import settings, I’m now clueless.

MAYBE I should also mention the fact that this particular image is coupled with a mask image.

Does that matters?

What should I try to do?

Thanks for your time!

P.S.: As suggested, I’m editing this to include the pics…

This is with jaggies, the orange colour is a flat layer, the Stamina itself is the mask I’m using on it
45991-screen-shot-2015-05-07-at-221643.png

This is a pic of the Stamina while you deplete it, if you look carefully the edges of the mask are not jagged
45992-screen-shot-2015-05-07-at-221658.png

Try creating the image sprite with an ideal resolution. (By ideal I mean to say that, in my game I was setting 300x300 facebook profile picture.But my dummy avatar image size was 1024x1024,which I was resizing and using. So I changed the size of my dummy avatar to 300x300. And set the max size to 256[closest to 300] and set import to 'Truecolor'. Although not very crisp, it did improve the jaggies.) :)

–

That's a nice idea! I'm going to try that, thanks!

–

please take a snapshot of the import settings and attach it here

–

Edited! thanks for the suggestion, sorry if it took me a while!

–

2 Answers

2

Found this question while searching about the same issue… I was able to get 100% clean masking by changing the ‘Compression’ setting for the texture to ‘None.’ Hope this helps anyone else who comes across this. :slight_smile:

It's not working actually.

–

Where is "Compression" setting?

–

Thank you man! This solved my issue perfectly! Just curious will there be any effects by doing so?

–

Try creating the image sprite with an ideal resolution. (By ideal I mean to say that, in my game I was setting 300x300 facebook profile picture.But my dummy avatar image size was 1024x1024,which I was resizing and using. So I changed the size of my dummy avatar to 300x300. And set the max size to 256[closest to 300] and set import to ‘Truecolor’. Although not very crisp, it did improve the jaggies.) :slight_smile:

As I was reworking the interface's elements from scratches, I decided to try out your suggestion also with those that I couldn't rescale ( I redrawn them bigger). The results are better, but when I mask an element with another, I still get a bit of jaggies! Thanks again for the suggestion!

–

This answer is partially correct, but I think this is only happening because Unity is generating mip maps for sprites that are displayed at lower-than-native resolution. Therefore, if you can't save your images at display resolution for some reason... ...With your texture selected in the project panel uncheck "mip maps" and watch the jaggies disappear. The downside of this is that the memory footprint for that texture is going to be larger than necessary when you build your game, so try to get them saved into your assets folder at the display resolution if possible.

–