Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Is sharp 1080p graphics possible on a 4k screen?

Discussion in '2D' started by piotrO, Apr 12, 2021.

  1. piotrO

    piotrO

    Joined:
    Dec 16, 2009
    Posts:
    46
    Hello,

    Is there any way to make content created with 1080p in mind appear sharp when viewed in 1080p on a 4k screen?

    Currently, when I open a standalone game on a 4k screen 1080p resolution the graphics is very blurry (mac os). The same content, when viewed in the editor with scale x3, is much sharper.

    I've checked other 2D games that weren't built in Unity, like Slay The Spire, and when I play it on my 4k screen in 1080p, the graphics are obviously upscaled, but not blurry.

    Maybe there are some build settings I'm missing?

    Any ideas would be appreciated!
     
  2. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    178
    Actually, i don't see how the result would be really bad as a 4k screen is a multiple of 1080. Are you sure that you don't have sprites that don't scale correctly? For example, if you have a sprite that is 100x80 and that you draw at 103x82.4, it would probably look worse on a bigger screen, assuming that the screen you use for your 1080 tests is of a different size than your 4k display.
     
  3. piotrO

    piotrO

    Joined:
    Dec 16, 2009
    Posts:
    46
    Well, actually, it's a 5k screen... But I'm not sure that matters.
    The problem is that the content looks blurry as it was scaled with bilinear algorithm - where it would look much better if it was scaled with something like nearest neighbour.
    I'm talking about all the content, mainly UI, canvas image, TMP text, etc.
     
  4. japhib

    japhib

    Joined:
    May 26, 2017
    Posts:
    65
    not that it really matters but Slay the Spire was built with libGDX, not Unity so they have a bit more control over exactly how stuff is rendered.

    If it's mainly UI, does a thread like this solve your problem? https://forum.unity.com/threads/blurry-text.563359/
     
  5. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    i think you actually have to change the resolution of the game to 4k

    when I start a project as 720p on a 1080p screen I also get much blurrier graphics than would be warranted

    seems like your game resolution needs to match your desktop resolution
     
  6. piotrO

    piotrO

    Joined:
    Dec 16, 2009
    Posts:
    46
    Thanks, for the suggestions and I think you're right (and this matches what I've read in other sources), there's not much you can do about the blurriness on a 4k monitor when playing in 1080p.

    The only viable solution seems to be... Not playing in 1080p on a 4k display.

    I was hoping to make the game look good in 1080p too, to save some CPU /GPU resources. But I think if you have a 4k display, your hardware setup should be more than capable of handling a 2D game.
     
  7. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    i think you need a reply from a unity dev here

    another solution is if you could use unity to force a change on desktop resolution from 4k to 1080p while running the game

    for example when I open up a rpgmaker 2003 game it forces my desktop resolution into 320x180, screws up my desktop icons- but the game runs correctly
     
  8. piotrO

    piotrO

    Joined:
    Dec 16, 2009
    Posts:
    46
    Thanks for the suggestion @rarac, can you tell me how to get a reply from a unity dev?
     
  9. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    I dont know, they sometimes respond if you are lucky

    I would actually want to know how to force desktop resolutions to change aswell
     
  10. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,319
    Screen.SetResolution(width, height, mode);

    Only works in built games. Within the Editor, Unity forces windowed mode.

    The best way to fix, if expensive time-wise, is to create your art at a higher resolution. You're probably looking to avoid that, though, if you're asking this question.
     
  11. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    this only changes the resolution of the game no?

    I was talking about changing the native resolution of the desktop
     
  12. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,319
  13. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    yeah what Im talking about is every old game you open resizes your desktop before opening up in full screen, when you alt tab or close the game all your desktop icons are displaced and your windows are resized, so it seems they really are changing your native resolution to fit the forced ingame resolution
     
  14. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    875
  15. piotrO

    piotrO

    Joined:
    Dec 16, 2009
    Posts:
    46
    Thank you, @Ted_Wikman for a good read. It doesn't solve my problem, though.

    Attached is a comparison of two screenshots:

    compare.png


    The top image was taken in the editor's game view and scaled to 2.65 (which is closest to 5120/1920).

    The bottom image is from a standalone build at 1920x1080 resolution, taken on a 5k screen.

    As you can see, the top image is much sharper. So the question is - can I achieve the same sharpness in a standalone build as I can in a game view scaled to 2.5?

    Thanks a lot!

    Here is the test project if you want to see it: https://www.dropbox.com/s/oncolef6hsqdvkg/FullScreenTest.zip?dl=0
     
  16. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,319
    You could try a sharpening post-process effect. There are a few on the Asset Store. The only real way, however, is to scale up your art so the source art is crisp at your maximum resolution.

    For text, make sure you're using TextMeshPro (TMP) b/c it uses signed distance fields (SDF) to have much crisper text than Unity's native solution (Text component). If still text is still blurry, rebuild your TMP text asset so that it targets a higher scale.
     
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,625
    I like the sharpening post effect idea. If you try it, please let us know how it works out. Thanks!