Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Standalone windows app runs half size on 4k?!

Discussion in 'Editor & General Support' started by andyz, Apr 18, 2019.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,284
    Not sure how Unity standalone, windowed builds are meant to run in 4k on windows but seems if you set default size to 1024x768 you will get a tiny window on 4k as it will literally use the same pixel size even though that is very unlikely to be what you want. Do windowed apps not act with the general settings - double size scaled by default?

    Edit, on top of this if you maximise a resizable window it takes over the monitor and you can not easily un-maximise it?!

    I think this is down to the "Windowed" fullscreen mode which is just a little broken I would suggest - if you do not tick the toggle fullscreen mode do you end up locked in fullscreen forever?!

    Also the UI is half size (physically) on 4k which seems unlikely to be what you want so do we have to manually code a scale factor to our UIs also?

    Hopefully I am doing something wrong because it seems easy to break a windows app on 4k currently! 2018.3.12
     
    Last edited: Apr 18, 2019
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Well 4k resolution is double 1080P resolution, so yeah it will be half the size. You can read the screen size and change your window size in code to a more appropriate size for high res displays. 1024x768 is a rather small window size for a game even on a 1080P display, so I'm not surprised it is broken small on 4K.

    As for UI you probably want to try the CanvasScaler component. (thanks for reminding me I hadn't yet implemented this for my latest game)

    https://docs.unity3d.com/Manual/script-CanvasScaler.html
    https://docs.unity3d.com/Manual/HOWTO-UIMultiResolution.html
     
    Last edited: Apr 18, 2019
  3. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,284
    1024x768 is just the default - the point is 4k is not well supported out of the box if you want to handle windowed mode in the same way across HD and 4k. If you chose a fix windowed size you would regret it for 4k users, at least you can make resizable.
    Standard windows apps will just double scale by default in 4k but using the 3d card, Unity does not and does not try to do so, yet on Mac you can toggle retina support or not.

    Well its something to look out for anyway and something to handle it would be nice - double scale on 4k UI tick box and double size window option (optional non-retina render via render texture).
     
    Joe-Censored likes this.