Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Mac Player Retina Support?

Discussion in '5.4 Beta' started by MHD-Salka, Jan 6, 2016.

  1. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    UPDATE:
    It seems that from beta 13 the player supports retina if you set the Graphics API for Mac to "Metal (Experimental)" in Player Settings. Retina support is only available in fullscreen mode, though.



    Original post:
    Hello! It seems that the editor now supports retina resolution on mac, but the Mac Unity player does not? Am I missing something? Will retina support for the mac player be added in the final release of Unity 5.4? Cheers
     
    Last edited: May 28, 2016
    MrEsquire, orb and deram_scholzara like this.
  2. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    Any words from the devs on that?
     
  3. aaronjbaptiste

    aaronjbaptiste

    Joined:
    Dec 4, 2012
    Posts:
    62
    I'd like to know this too. Although I'm a little confused with the differences at the moment - For me my UI is now showing very small in the Editor Game preview, but perfectly fine in the build. Is the fact that the UI (in game) being affected by the retina scaling a bug?
     
  4. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    Yeah that's exactly the issue. Editors runs at retina resolution while the player does not.
     
  5. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Yep, the Game View runs at native resolution.

    I'm currently making my asset xARM 5.4 ready and this causes some issues while changing the Game View resolution.
    What's the best way to detect if the Editor runs in retina mode?
    I couldn't find a flag yet.
     
  6. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    The Player (and game code) do not currently support retina, and will not for 5.4.

    The Game View runs at whatever resolution you set it to. When set to Free or a specific aspect ratio, it will use all the available pixels.
     
  7. aaronjbaptiste

    aaronjbaptiste

    Joined:
    Dec 4, 2012
    Posts:
    62
    I think this makes the Free Aspect mode useless on HD displays. The UI is just far too small. Macs (and Windows actually) usually scale up the UI in other apps so it's x2 - giving you double the resolution but text etc appears to be the same size.

    Setting Scale to x2 does not really work either, the game is cropped around all edges. I've also tried playing around with the Canvas Scaler component but it doesn't seem to work correctly for me.
     
  8. TimCabbage

    TimCabbage

    Joined:
    Feb 13, 2011
    Posts:
    66
    I've successfully implemented the UI scaling for any resolution by setting the pixel size to constant and changing the scale factor to whatever number would look good(+ take into account the user settings there)
    You need to design all Your UI sprites around that - reference ppu and ppu in sprites and texture import settings need to be properly set.
    Then it works very well.
     
  9. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    sivael : your solution is working only for standard hidpi screens on Windows (and maybe Linux - not tested) but will not work on MacOS with Retina support.
    I am doing that and it works perfectly on Windows with a hidpi screen but on MacOS, the game thinks the dpi is ~110 instead of ~220...

    The render on retina is the good size but everything is pixelated... I would like to use the non retina resolution inside the app and then scale the UI manually but it seems to be impossible...

    Am I missing something?
    Should I tweak the info.plist file in the generated .app ? I will test that but not sure it will work...
     
  10. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    What do you mean by "set to free"?
    My game work very well on hidpi screens on Windows standalone by detecting dpi at runtime and then scale up UI but the standalone Mac only detects a 110dpi (instead of 220) and everything is already scaled up 2x in an horrible pixelated fashion... I would like to be able to use all available pixels and do the scale myself...

    EDIT: Even in fullscreen, on a MacBookPro Retina 15", it detects a resolution of 2880x1800 but the detected DPI is still 110 (110.5 exactly) instead of 220. The result has expected proportions, the UI needs to be scale 2x to be at right size but the whole is pixelated as if the used resolution was 1440x900 scaled up in a nearest-neighbor (point) "filter"...
     
    Last edited: May 23, 2016
  11. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    UPDATE:

    It seems that from b13 the player supports retina if you set the Graphics API for Mac to "Metal (Experimental)" in Player Settings. Retina support is only available in fullscreen mode, though.
     
  12. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    Thanks for your answer MHD Salka.
    I searched for the "Metal (Experimental)" option in Player settings but found nothing... I tried in Unity 5.4.0b18
     
  13. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    You need to uncheck "Auto Graphics API for Mac" check box then add Metal to the list of supported graphics APIs. I'm still using b13.

     
    Last edited: May 28, 2016
  14. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    OK tried it... The UI is working (but still not in retina) and the 3D is completely messed up with the void effect (repeating part of picture, flowing down, especially visible when resizing the window when in windowed mode)...
    In fullscreen, the UI is wrongly stretched, 3D is void and the whole is not Retina... XD

    Even in OpenGL2 (deprecated), the game does not work as expected with strange artifacts in 3D...

    EDIT: tested on MacBook Pro Retina 15" in OSX El Capitan 10.11.5 / Unity Pro 5.4.0b18
     
  15. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    You need to turn off "Resizable Window" in Resolution and Presentation. And make sure the app is running in full screen mode.
     
    Last edited: May 28, 2016
  16. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    oh... :/
    I will test that to know if that will work in fullscreen at least as you say but my game must run in windowed mode by default :(
    Thanks again for your help! :)

    EDIT: Tested and no luck... The exact same problems are happening... And it seems the Game refuse to start in fullscreen by default even with the checkbox "Default is Fullscreen" checked. The box "Resizable window" is disabled and the collision detection of UI works in native resolution but the whole UI is weirdly stretched... and in non retina
     
    Last edited: May 28, 2016
  17. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72

    Hmmm, not sure why would this happen, are you running OSX Elcapitan (Metal is only supported there)? if yes then maybe something went wrong with b18 or could be a project/graphics driver specific issue.
     
  18. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    Yes I run OSX El Capitan (MacBook Pro Retina 15" in OSX El Capitan 10.11.5 / Unity Pro 5.4.0b18)
     
  19. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I don't understand why anyone would want the player to use retina support. If you're using the Unity GUI, it will scale everything for you. The last thing I want is for the OS to second guess my resolution settings and start resizing things for me, and giving me fake DPI settings, etc.
     
  20. z000z

    z000z

    Joined:
    Dec 31, 2014
    Posts:
    96
    It scales it for you but you don't actually get any increased resolution in the player atm (at least in windowed apps). It renders non retina resolutions atm, so if you're a full screen window on a 15" retina mac you're running at 1440x900, instead of 2880x1800, meaning you're UI/graphics aren't as nice and crisp as they could be (assuming you're app/game can handle the extra resolution).
     
  21. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    Jaimi: You should test a standalone game on a Mac with retina support to best understand the issue.

    On a 2880x1800 capable screen (retina with 200dpi), a standalone Unity game runs at 1440x900 resolution (110dpi) with scaled render to 2880x1800, resulting in pixelated result... More thant that, Unity detects (at runtime) a resolution of 2880x1800 but a dpi of 110! That's completely broken and that's just odd, nothing has been done on that for years!

    What would be nice is Unity rendering at real window/screen resolution, letting the developer scale it's UI himself if necessary. That's what I do on Windows with hidpi screens, and everything works as expected.
     
    orb likes this.
  22. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    In addition to looking wonky it also makes screen recording next to impossible. Even windowed mode can screw up.
     
  23. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Wow, I'd always just assumed that is what is happening. I don't have a Retina screen (Mine is 2560x1440). My problems are all just the exact opposite - the Editor is hard to use because all the fonts are so small. I was hoping "Retina Support" would help out somehow with this.
     
  24. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    It could, as a side-effect. When scaling for all sorts of resolutions they may rethink how it's done. I'd really like to see a fully resizable interface, like Ableton Live has.
     
  25. Sphax84

    Sphax84

    Joined:
    Jun 23, 2015
    Posts:
    36
    Retina is simply not supported at the moment in Unity Standalones...

    Please support this entry by giving as much votes as possible to have a chance this to happen:https://feedback.unity3d.com/suggestions/retina-for-os-x-standalone-builds

    Jaimi: By the way, I'm talking about Retina (=MacOS) not HiDPI.Unity on Windows (and probably Linux) can handle HiDPI screens very well. But as soon as the standalone is a MacOS one, HiDPI can't work because Retina thinks the resolution is half the real one, renders it on the half resolution and then scale it to fit the window (= ugly pixels).