Search Unity

Blurry sprites despite being set to "Point(no filter)"

Discussion in 'Editor & General Support' started by MosquitoByte, Mar 4, 2020.

  1. MosquitoByte

    MosquitoByte

    Joined:
    Sep 17, 2018
    Posts:
    213
    For some odd reason, the sprite being used for my games background is very blurry, despite that i set the sprite import settings to be point no filter, which has in the past always fixed this problem. below is a picture of an example, and the import settings

    what a bookcase looks like in-game:
    https://i.gyazo.com/733131b637c0e2b297afc1d99bd37b04.png

    what it should look like:
    https://i.gyazo.com/ad94c9b4e5f94a264db026f0eb38a4c0.png

    import settings:
    https://i.gyazo.com/677de434a37d0baa39378552c187019e.png
     
  2. Kentorianx

    Kentorianx

    Joined:
    Jan 22, 2018
    Posts:
    5
    What version of unity are you using?, what are the settings of your camera?, did u created the project as a 2D project?, also the ingame screenshot is in playmode?
     
  3. MosquitoByte

    MosquitoByte

    Joined:
    Sep 17, 2018
    Posts:
    213
  4. MosquitoByte

    MosquitoByte

    Joined:
    Sep 17, 2018
    Posts:
    213
  5. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    If you have anti-aliasing on in the graphics settings, it could blur the entire frame. Are you using any post-processing or render textures?

    Also, in the import settings, try setting the compression to "none"
     
  6. MosquitoByte

    MosquitoByte

    Joined:
    Sep 17, 2018
    Posts:
    213
    i dont think i have any post processing effects on, i never really mess with any of the default settings unless i have to, and where would i check to see if i were? Oddly enough setting the player sprite to "point(no filter)" and setting its compression to none makes it look crystal clear, but this does not work at all for the background itself

    edit: it actually does work, but the difference is so slight it may as well not exist! look at this:
    https://i.gyazo.com/9922eed6b3476cc2bcb872fcbe335cf9.gif

    compared to what this same spot looks like in the drawing being used for the sprite:
    https://i.gyazo.com/65ae09a2881c6abedd1a92919214a072.png
     
    Last edited: Mar 5, 2020
  7. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    What is the "background" in this case? Is it a sprite? textured quad? UI element?
     
  8. MosquitoByte

    MosquitoByte

    Joined:
    Sep 17, 2018
    Posts:
    213
    I managed to solve the problem by cutting the background into smaller pieces. I was using a single large image as the entire playable area in the game, which made it blurry. Why is that? its not a problem for me to fix with this game because its just crude sprite art, but what if someone were trying to use a similar trick, but with their background actually needing the higher fidelity?
     
  9. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    Was it bigger than 2048x2048? That's the max size specified in your import settings, so if the image is larger then that it will be resampled down to the max size, which would make it blurry.

    If you were doing a big, hi-res background, it would probably be a good-idea to cut-it up into smaller pieces in any case. The entire image will need to be copied to the GPU in order for any part of it to be rendered and there are hard-limits on VRAM.
     
  10. ashutosh619-sudo

    ashutosh619-sudo

    Joined:
    Sep 27, 2020
    Posts:
    1
    guys I tried everything but nothing is working, I have a character and whenever I import it, it is blurring out but only in game mode it is fine in scene view. help me.
     
  11. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    Same here.

    Updated to 2019.4.15f1 on a project so I could fix the input of older versions; and it worked great. Broke video so I had to change how I approached that and now working; great.

    But all sprites are blurry with Point(no filter) as if it were bilinear filter when playing the build only, windows build; working as intended while in the editor.
     
    Last edited: Jan 18, 2021
  12. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    Still broken in 2019.4.18f1.
    Still broken in 2020.2.1f1.

    What am I supposed to tell me client? They choose between having controllers that don't work but their art will be correct or instead controllers that work but everything being blurry?

    With version 2019.1.10f1 controllers are all kinds of broken on a new build but if the user runs the application, closes it, then restarts their PC the controllers for local multiplayer start to work perfectly as intended.

    With version 2019.4.15f1 and beyond, in where I do not change any of my code for controllers and using the same input system, it works first run on any new build but everything is blurry because even though the art is Point(no filter) it behaves as if bilinear filter in builds.
     
  13. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    There are several things that can make your sprites appear blurry besides the filter mode:

    Make sure that you set your texture type to "sprite" in the import settings.

    Make sure that Mip-Map generation is off.

    Make sure that your sprite is not being automatically resized. Make sure that import settings "Max Size" is not smaller than your texture. Notice that it's an override-able setting for each build platform so check the platform that you're building to.

    Make sure that compression is off.

    Are the dimensions of your sprites a power of two?
     
  14. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    All the things you mention are set.

    This happens from updating my version from 2019.1.10f1 to a later version in where they fixed the input system. My importer script still works and I can see that by trying to change any specific graphic. All of my setting appear unchanged and unable to find something that will cause this to happen. Fullscreen in the editor displays as intended and all built versions(building for windows) have the blurring effect.
     
  15. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    I started a new project and imported a single sprite and cannot seem to reproduce. Not sure what is causing the issue in updated project compared to a new project; comparing everything but coming up empty.
     
  16. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    The problem is related to default screen width and height and aspect ratio. Client has me using some whacky resolution and in/or not in combination with AspectUtility script there is some problem with newer versions that did not exist before. Not an expert on this subject so unsure of a solution besides using something that is likely rounding better; such as 1920x1080 or vice versa.

    Would anyone have a solution for making a 420x240(1.75) work as a locked aspect ratio?
     
    Last edited: Jan 18, 2021
  17. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    How would I accomplish this without causing a blurring effect on the build? I'd like to just cut off the excess from the sides of 16:9 to conform to the aspect ratio.

    Code (CSharp):
    1.         Camera camera = Camera.main;
    2.         float scalewidth = 1.75f;
    3.         Rect rect = camera.rect;
    4.         rect.width = scalewidth;
    5.         rect.height = 1.0f;
    6.         rect.x = (1.0f - scalewidth) / 2.0f;
    7.         camera.rect = rect;
     
    Last edited: Jan 25, 2021
  18. NonhumanStoltz

    NonhumanStoltz

    Joined:
    Dec 6, 2020
    Posts:
    19
    Max Size setting worked for me. I cranked it up after digging through forums. It's a really small yet easy detail to miss.
     
  19. chrisheld

    chrisheld

    Joined:
    Apr 15, 2013
    Posts:
    8
    I had the same problem and I just solved it. Are you using a Texture Atlas? If so, check the filter mode there. I had all my sprites importing using a Texture Importer (Preset) with Filter mode Point. However, the Atlas had filter mode of bilinear.
     
    opsgamestudio and voidzero666 like this.