Blurry sprites depending on scale

Hello guys!

I bumped into the following undesired behavior.
Everything I have on the screen can be noticeable blurry depending on objects scale. It’s about either GUI and Game Objects. E.g. I have a GUI element:

btn_good

as you can see the quality is quite good and that’s my target quality. But if I change window size just a little bit (no matter make it bigger or smaller) then the element gets quality like this:

btn_bad

If I go on changing window size then sometimes I get perfect quality and sometimes unacceptably bad, and all this happens as I said not depending on scale up or scale down, any direction.

In the editor the quality is always good no matter which scale, but in Windows build and HTML5 build that thing above happens.

What can be a reason and how to solve the problem?

Thanks in advance!

Noticed that it gets blurry after ~2x scale down. Seems like I cannot put 100x100 png into an atlas and then when using scale it down to 50x50. Is this the case?

Maybe thread with my question will be helpful for you. I had more or less the same problem with sprites quality.

1 Like

Oh that’s exactly what I was looking for. I turned off mipmap and now everything is great.
I already found similar posts about mipmaps before but there it looked like not something I was looking for, but in your thread Pkeod explained it much better.

For others: the exact solution post is here - GO with sprite. Sprite quality while go.set_scale (Solved) - #2 by Pkeod

Thanks @Pkeod and @russelkgd!

2 Likes

BTW @Pkeod also mentioned

if you do that you’ll want to disable mipmap generation potentially

What does that mean? I turned off mipmap for some of my sprites and for GUI through their material, but how to “disable mipmap generation” and whether it gives some performance profit or something?

Use a custom texture profile to disable mipmap generation. The main benefit is the bundle size reduction, about 30%.

Regarding linear filtering without mipmapping. The pros:

  • sprites look sharp.

The cons:

  • decrease of performance because GPU cache misses if you draw a tiny image from a large texture.
  • sprites look too much sharp if you draw tiny (i.e. scaled down) images from a large texture.

Another solution for the problem is Sharp Sprite.

6 Likes

Disabling mipmap generation is done in your texture profiles. Texture profile asset selection is done in the list by more specific to more general. The reason to do it is if you’re not using them you may as well not generate them. :slight_smile:


6 Likes

Thank you all guys, it’s pretty comprehensive! Everything is fixed now :+1:

4 Likes