Problem with forcing 1024x768 mode on Retina iPads

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.

I have same problem. Looks Auto(best performance) setting does not work anymore in Unity4.5.

as a workaround you can set resolution manually

though i would like to see bug report with repro project - we dont like regressions :wink:

That worked, thanks. For now this seems to be good solution. I am not sure how to send a bug report…

http://unity3d.com/BugReportingFAQ

@Alexey any news on this - I’m having the same issue, in my situation neither ‘Auto (Best Performance)’ or ‘Auto (Best Quality)’ actually do anything… I submitted a bug report today: http://fogbugz.unity3d.com/default.asp?627099_07g4iukk05u0crhk

Just as an update @Alexey , by coincidence someone on Reddit encountered the same issue today (Reddit - Dive into anything) 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!

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

Fantastic - thanks @Alexey !

No luck with the “UnityRequestRenderingResolution(resW, resH);” or using Screen.SetResolution with Unity3d 4.5.3

Petr

@petrapparent I’m using 4.5.3p2 (from here Unity Patch Releases - Industries - News & General Discussion - Unity Discussions) and SetResolution is working fine for me. I haven’t actually implemented @Alexey 's fix so can’t comment on whether that works or not.

I did have an email from Unity yesterday saying that this bug has been fixed and will be included in the next patch release.

1 Like

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.

1 Like

Hi Thijs,

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

Petr

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

Thanks adslit, that worked. No need to use SetResolution or anything else. Simply applying the 4.5.3p3 (patch 3) solved the issue.

Petr