Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Display Resolution Dialog: The 2019.3 replacement for those who can't live without it! :)

Discussion in 'Windows' started by CodeSmile, May 23, 2020.

  1. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,066
    SHOCK! Unity deprecated and rather quickly removed the resolution dialog without a proper replacement! :eek:

    Then they gave us a C/C++ Screen Selector project that's really ugly to get working (particularly if you don't have a C/C++ Windows SDK background) and is nowhere near as convenient to use. For instance, default resolution is always 640x480. And how do I make it to run my Unity app after clicking Play? :mad:

    "Based on user data and customer research" ... well, I have a hunch in this case it's nowhere as obvious as, say, the removal of .. what was it called? That scripting language that no one even remembers existed 5 years ago when it was still part of Unity. Ah .. yes, Boo! So no, some of us do need the resolution dialog! Dearly so. :(

    I understand, if it's in the way of something new and great, by all means remove it and (gradually) replace it with something better, less buggier. But user data and customer research? Come on. We're the 10% you ignored who make non-public apps or just like to tinker with settings and generally dislike sending usage data to Unity! :p

    Enough ranting ... the good thing about this is, it's something we can simply fix this and bring it back - and making it even better! :cool:

    So without further ado here's the replacement I've come up with:

    Screenshot from the editor. Actual data will differ. 16k? We're not quite there yet. ;)


    What's cool about this?
    • FREE! Released under MIT License.
    • When used as the first (launch) scene it will automatically load the second scene in the Build Settings list when pressing Play.
    • Can also act as a popup in any scene. Press ESC (configurable) to bring it up. The Play/Quit buttons will be replaced with a "Close" button.
    • Has absolutely no dependencies to whatever. Not even TMPro. Just plain Unity 2019.3.
    • More features than the old Unity Resolution Dialog:
      • Changes are applied instantly!
      • Select refresh rate (exclusive fullscreen only - windowed modes use the desktop refresh rate)
      • Adjust Vsync Count: off, vsync on, vsync every 2nd, 3rd or 4th frame (useful as framerate limiter)
      • Built-in FPS display so you can see the difference in fps when changing settings
    Caveats:
    • No option to display dialog only when Shift or Alt are held down (see comment #4)
    • Switching Displays requires restarting the app. Due to lack of a 2nd monitor I have only been able to test this once.
    • Tested only on Windows but should work on Mac OS X and Linux. Probably useless on any other platform except changing quality levels.
    • In editor anything but Quality Level is locked because all other settings are controlled by the editor respectively not available in windowed mode.
    • No input support. That's the one aspect of the original dialog I've never had any use for.
    Feel free to leave feedback or better yet: fix anything that ain't working and send a pull request.
     
    Last edited: May 24, 2020
    Anna-Mae, Neiist, LilGames and 33 others like this.
  2. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    465
    Legend
     
  3. Twyker_gp

    Twyker_gp

    Joined:
    Dec 4, 2018
    Posts:
    29
    Does it also work like the old original one, where you could start it with Shift+Click only?
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,066
    Unfortunately not. It would have been a rather odd behaviour therefore I opted not to try and mimic this behaviour.

    The reason is: GetKey() only works in Update(), and apparently while a scene is loading or in the first scene, the first time keys are registered/received happens at the earliest in the 3rd time Update() gets called. So you would see the dialog anyway for 3 frames even if not holding down Shift or Alt.

    Perhaps someone knows a trick or workaround to this? I can only think of hiding the dialog for the first few frames so it wouldn't feel as odd, but you'd still have to keep the Shift/Alt key pressed for sometime longer compared to the original dialog due to Unity having to initialize first.
     
    KarlKarl2000 likes this.
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,510
    Thanks for making this!!
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    It's super-cool that you have created and shared this! Unfortunately, for the use case of VR games, the shift/alt-feature was all I (and quite a few players) ever needed that resolution dialog for.

    It really sucks that Unity removed it.
     
    Twyker_gp and Lars-Steenhoff like this.
  7. dre788

    dre788

    Joined:
    Feb 15, 2013
    Posts:
    52
    The unity package link seems to be broken.
     
    nehvaleem likes this.
  8. Lenakeiz

    Lenakeiz

    Joined:
    Jun 11, 2015
    Posts:
    34
    Thank you for this. It s incredible how Unity removed such a great feature like that ad now we need to find workaround for such a useful feature. Why they just didn't let us to enable/disable it?
     
  9. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    262
    Hey I just wanted to say thanks for building this. Totally agreed that Unity shouldn't have abruptly removed their original selector without a replacement... but yours is very good!
     
  10. mibragg

    mibragg

    Joined:
    Apr 10, 2015
    Posts:
    3
    Steffen Itterheim

    I also want to thank you for your work. I wanted to provide users with the chance to drop to a lower resolution if their FPS is too low... Bonus it can perform this dynamically at runtime. Used GraphicsSettingsHandler script with my own front end. Saved me a lot of research, trial and error and I learned something. Appreciate it.
     
  11. zarmonela

    zarmonela

    Joined:
    Jun 17, 2020
    Posts:
    4
    Nice! can it be used for dual display? I mean one stand alone scene viewing on both displays?
     
  12. Arealight

    Arealight

    Joined:
    May 4, 2017
    Posts:
    29
    This one dosent work right with Unity 2021, The Windowed option don't work. Any update on this?
     
    Last edited: May 12, 2023
  13. Arealight

    Arealight

    Joined:
    May 4, 2017
    Posts:
    29
    Can get it to work right in latest 2022. The screensize dont affect change. Only when restart. qwality setting is on Very Low in the start, even when I sett it to Ultra. Please can you update! Thanks in advance.