DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1

    @ smiteworks: Allow unity to do the scaling instead of OSX

    Super simple fix;

    Drop the following into the Info.plist in the app bundle.

    Code:
    	<key>NSHighResolutionCapable</key>
    	<false/>
    What does this do? It stops Mac OS X from scaling the contents of the window for you on high dpi displays, and allows unity to do it. This means your font rendering, everything, will be way crisper.

    It will require users to set a scale greater than 100% though obviously - but because you'll be scaling internally rather than just getting the pixel doubling from the OS, things will render much better.

    I can't test it myself because the binaries are signed and I don't want to resign your binaries, but I've done this with my own projects using SFML and gotten good results.

  2. #2
    Larsenex's Avatar
    Join Date
    Sep 2018
    Location
    Longview, Texas
    Posts
    541
    What about those of us who run on 1440P 34" wide monitors who want to scale to 80%?

  3. #3
    ddavison's Avatar
    Join Date
    Sep 2008
    Posts
    6,134
    Blog Entries
    21
    Thanks. I passed this on to our Mac dev and our lead dev.

  4. #4
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,267
    Blog Entries
    9
    /scaleui 80?

    But just guessing since I'm not familiar enough with matjam's suggestion to know.

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  5. #5
    Quote Originally Posted by Larsenex View Post
    What about those of us who run on 1440P 34" wide monitors who want to scale to 80%?
    It will improve the experience for all Mac users as the application will render one application pixel per screen pixel. Currently what happens is if the display is scaled at all (ie not set to native resolution), one application pixel might be 1.5 screen pixels. Doing any scaling in unity cannot fix that - the OS is doing its own scaling after the application renders. The result is blurry text.

    Quote Originally Posted by LordEntrails View Post
    /scaleui 80?

    But just guessing since I'm not familiar enough with matjam's suggestion to know.
    Yeah this just means unity renders things smaller and OS X will then scale that low resolution text up. What you want is for OS X to do no scaling at all and allow unity to do all scaling internally.

    There’s a similar issue with Windows. It’s worked around by setting the compatibility options in the shortcut for hi dpi displays to “application”.

    @ddavison thanks!

  6. #6
    Thanks for sharing. I've actually been trying to find a way to set this in the application directly as part of the build process for both Windows and Mac builds. It's one of those things that I occasionally have been investigating as we go, but have never found a great answer.

    * Has anyone found a way to override this in Unity directly?
    * Has anyone found a way to specify the override in Windows in an application without having to use a shortcut?

    Regards,
    JPG

  7. #7
    Quote Originally Posted by Moon Wizard View Post
    Thanks for sharing. I've actually been trying to find a way to set this in the application directly as part of the build process for both Windows and Mac builds. It's one of those things that I occasionally have been investigating as we go, but have never found a great answer.

    * Has anyone found a way to override this in Unity directly?
    * Has anyone found a way to specify the override in Windows in an application without having to use a shortcut?

    Regards,
    JPG
    Stupid question; I haven't used unity but I'm guessing you did the google and tried the obvious;

    https://docs.unity3d.com/2020.2/Docu...creen-dpi.html

    plus

    https://docs.unity3d.com/2020.2/Docu...DPIFactor.html

  8. #8
    The first one is just a static value you can retrieve.
    The second one is set to 1x for our builds already, which seems like exactly what we want.

    The problem is that there are no variables that I can find that tell us anything about whether the OS has designated a display as High DPI, nor whether the application will trigger the OS "scaling", nor how I can override that scaling. As noted in your first post, you can override by manually modifying some of the executable helper files on Mac, but that's a post-process step that's unique to Mac. I would prefer to have an officially supported "solution", but I know there is not always one.

    Regards,
    JPG

  9. #9
    I think the intent is take the value from the first API call, and depending on that value, you set the second. I don't have any experience with unity though so I was flailing around trying to get it to work and gave up.

    Other than those two APIs in Unity, that's the only "unity" way I could find to do it. Presumably you have support with Unity so you could ask them.

    If you've the ability to make underlying library calls, there's Win32 APIs and MacOS foundation library calls that you can make to do what you want.

    So, you're going to get stuck with some platform specific code, or some manifest and bundle plist thing that you need to bake into the build system.



    I had a look at unity though, and it doesn't look like it gives you that kind of low level call?

    Windows has this:

    https://docs.microsoft.com/en-us/win...-for-a-process

    I did find some other related win32 calls.

    Here's the tech note on the apple stuff; https://developer.apple.com/library/...012302-CH4-SW3


    Does the NSHighResolutionCapable key actually work? I'm not 100% sure; be good if you're able to confirm at least that works.

    Also, linux is a nightmare. LOL.

  10. #10
    Yeah, I agree. I'm pretty sure that we'll have to do some pre/post build steps in order to override this in Unity for Windows/Mac. I've been holding out a bit hoping that I'll find another answer, but probably something we'll tackle before release.

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Character Create Playlist

Log in

Log in