Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Problem with forcing 1024x768 mode on Retina iPads

Discussion in 'iOS and tvOS' started by Rob-Hafey, Jul 24, 2014.

  1. Rob-Hafey

    Rob-Hafey

    Joined:
    Jul 24, 2014
    Posts:
    12
    I have have an app in which I previously used 768 mode for rendering on an iPad2 or Retina iPad. Everything was working fine. Recently I upgraded to 4.5.2, did another build and now the Retina iPads run in HD mode even though my build settings are Target Device (iPad Only) and Target Resolution (768p iPad). I can't absolutely blame the upgrade for the problem but I can't see any other settings that have changed.

    I also debugged XCODE while running. The resolution target is coming in fine at 768p (QueryTargetResolution) in DeviceSettings.mm) but once the screen starts to initialize the settings are HD (2048x1536) in DisplayConnection.init. Should Unity be forcing 768p res mode? I am not completely sure how this works but something seems to be going wrong and I need to do another release!

    I have seem a few posts on how to force the mode but most of those posts seem to be old. Any help is appreciated.
     
  2. muzerly

    muzerly

    Joined:
    Jun 24, 2013
    Posts:
    22
    I have same problem. Looks Auto(best performance) setting does not work anymore in Unity4.5.
     
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
  4. Rob-Hafey

    Rob-Hafey

    Joined:
    Jul 24, 2014
    Posts:
    12
    That worked, thanks. For now this seems to be good solution. I am not sure how to send a bug report...
     
  5. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
  6. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
  7. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Just as an update @Alexey, by coincidence someone on Reddit encountered the same issue today (http://www.reddit.com/r/Unity3D/comments/2e02mz/screensetresolution_on_iphone_results_in_black/) and they figured out that 4.5.0 works correctly. I then tried building on 4.5.1, 4.5.2 and 4.5.3 and none of them work. So it seems to be a regression that started with 4.5.1 - hopefully that'll help you narrow down the issue!

    If it's an Xcode project issue rather than strictly a Unity issue (which would be my first guess) then steps to fix the project would be *hugely* helpful. I'm unfortunately in 'submit to apple' week so this has all got me rather stressed!
     
  8. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    you need UnityAppController+Rendering.mm
    search for
    extern "C" int CreateContext_UnityCallback(UIWindow** window, int* screenWidth, int* screenHeight, int* openglesVersion)

    and after
    QueryTargetResolution(&resW, &resH);
    add
    UnityRequestRenderingResolution(resW, resH);

    so it will look like this:

    extern "C" int CreateContext_UnityCallback(UIWindow** window, int* screenWidth, int* screenHeight, int* openglesVersion)
    {
    extern void QueryTargetResolution(int* targetW, int* targetH);

    int resW=0, resH=0;
    QueryTargetResolution(&resW, &resH);
    UnityRequestRenderingResolution(resW, resH);
    <....>


    will sure go into some upcoming patch/release
     
  9. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
  10. petrapparent

    petrapparent

    Joined:
    Jun 6, 2011
    Posts:
    28
    No luck with the "UnityRequestRenderingResolution(resW, resH);" or using Screen.SetResolution with Unity3d 4.5.3

    Petr
     
  11. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    petrapparent likes this.
  12. vandenberg-thijs

    vandenberg-thijs

    Joined:
    Jul 31, 2013
    Posts:
    13
    Hi, just like to chime in on this. Came across the same issue. For me, reverting back to Unity 4.5.0 solves things. Changing Xcode versions has no effect, this really does seem to be a Unity issue.
     
    petrapparent likes this.
  13. petrapparent

    petrapparent

    Joined:
    Jun 6, 2011
    Posts:
    28
    Hi Thijs,

    Can you revert an existing 4.5.3 project to 4.5.0? I thought that was impossible.

    Petr
     
  14. petrapparent

    petrapparent

    Joined:
    Jun 6, 2011
    Posts:
    28
    Hi,

    Looks like this error exists in Unity 4.6 beta 17 as well. Sigh, ok, I'm now reverting back to 4.5.0

    Petr
     
  15. petrapparent

    petrapparent

    Joined:
    Jun 6, 2011
    Posts:
    28
    Thanks adslit, that worked. No need to use SetResolution or anything else. Simply applying the 4.5.3p3 (patch 3) solved the issue.

    Petr