The screenshot requirement size is 2208 x 1242 for iPhone 6. But i also thought the phones resolution was supposed to be 1920 x 1080, so also confused.
Yes, I found that as well, jesusluvsyooh. I use screen.width a lot, but had used 1920 to detect the 6 Plus, and suddenly I am thinking it should have been 2208.
Several websites says the iPhone 6 plus renders at 2208 x 1242 pixels UNLESS you use Metal which has direct access to the native resolution of the screen. Which (if really true) would mean than any game made with Unity 4 will have a huge performance penalty to deal with because Metal will be supported by Unity 5 only. BTW: It also seems the iPhone 6 UPSCALES from a lower rendering resolution without Metal.
Native resolution of iPhone6+ is 1080p. This page explains it quite good. http://www.paintcodeapp.com/news/iphone-6-screens-demystified
That's the screen resolution, though, which is downscaled. The native resolution (what the GPU is actually rendering) seems to be 1242 x 2208 from everything I've read. --Eric
Unless Unity is upgraded to use Metal which is the only way to access the screen directly, but according to blog posts of Aras Unity 5 will use Metal.
Say you weren't using Metal, and you rendered at 621x1104 for performance reasons, would it be upscaled to 1242x2208 and then downscaled to 1080x1920? Crazy. --Eric
I just did a little test and with a 4.5.4p1 project running on an iPhone 6 Plus I'm getting: Screen.width = 1920 Screen.height = 1080 Screen.dpi = 480 That DPI looks perplexing to me. I'd expect it to be the true DPI of the display (401) if the screen dimensions are the true screen resolution (1920x1080) but also since apparently we're rendering at the full virtual framebuffer size shouldn't the width and height be reported as 2208x1242 and the DPI be reported as 461?
Hmm, I just tested an iPad mini with Retina Display and that is also reporting an inaccurate DPI (260, when it should be 326). It looks like the code that calculates the DPI in DeviceSettings.mm simply hasn't been updated for the newer devices. I'll file a bug tomorrow. For the resolution, though, I'm not entirely convinced that Unity is actually rendering at 2208x1242. Unity has always been able to render at non-native resolutions on iOS, so I wonder if on iPhone 6 Plus we're simply rendering at 1920x1080, and then it's being scaled up to 2208x1242 by the OS for compositing with overlays and such, and then scaled back down to 1920x1080 for display? Presumably the answer to that question is in DisplayManager.mm if anyone less tired than me feels like digging through it.
Yes they are, but that doesn't really tell you what resolution the engine is rendering at, since it could be being scaled up to be composited with overlays like Control Center. Old apps like Google Maps that haven't been updated for the new screen sizes also produce 2208x1242 screenshots.
This german article (of the most serious german computer magazine) says that Metal is required to render at native screen resolution and games without using Metal will lose 3D performance due to rendering at an unnecessary higher resolution. http://www.heise.de/ct/artikel/Appl...chirmaufloesungen-2394857.html?artikelseite=2 I doubt that system overlays are done at 2208x1242, beside that all (even new ones) apps should produce screenshots in 2208x1242 - could you please download one of those metal game demos and make a screenshot, would be interesting to see if it will look like being upscaled for the screenshot resolution or if it will be in 1920x1080
https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html#//apple_ref/doc/uid/TP40014205-DontLinkElementID_1 "or OpelGL ES" - hence Unity should render at 1920x1080. false alarm
Just chiming in to confirm that from 4.5.4p1 and 5.0 for iPhone 6+ Unity by default should use 1920x1080, and this goes both for OpenGL ES and Metal. This is the correct one, because we want to skip downscaling step for performance reasons. If you see otherwise, submit a bug report. P.S. incorrect DPI is a bug.
Thanks very much for the confirmation. I submitted a bug last night with a (slightly elaborate) fix for the DPI bug. I tried to make the function more future proof by guessing the DPI for unknown devices based on the screen width in points as reported by the OS. I'll attach it here just in case it's useful for anyone else straight away.
It's great that Unity already supports native 1080! I could see this happening when I ran my game in both Standard and Zoom (pretends to be an iPhone 6 non-Plus). Everything came out identical. Which I guess means I can't test the non-Plus size on the Plus, but it also means I don't have to address Zoom mode at all. Good! And screenshots are definitely scaled up (as is the game any time a system overlay appears, I believe) because my game is non-AA, and the screenshots clearly have enlarged pixels yet with soft edges. Clearly scaled up.
Resurfacing this thread. I'm seeing a different behaviour than I had on Unity 5.3. When I launch my app on iOS, one of my first monobehaviour scripts that runs which happens to be a ui management related class, reads Screen.width during Awake, and on an iPhone 6S Plus I get a width of: 2208. Then I start logging Screen.width from OnGUI, for about 4 update calls to OnGUI I get 2208. Then it changes to 1920. From that point onward it always remains 1920. This is really bad, cause now I have no way of knowing which resolution to listen to. I now need to add some super hackish code that listens for a change of the screen resolution before proceeding and rendering my UI (Im not using the new built in Unity UI btw). But I can't think of a good way to do this that will work cross-platform or work for all device types, like I'd have to add an iPhone Plus only hack. Oh man. I'm using 5.4.0p4, the 6S Plus is running iOS9.3.4.
anyone from Unity know if there's an event or something I can listen to that can reliably tell me when it's safe to start reading Screen.width?
I've created a bug report, I'll post the tracking number when I get the confirmation email. But I confirmed this bug by making the absolute simplest example project. Just start logging the Screen.width and run this on an iPhone 6S Plus, you'll see the value report 2208 for a 3-4 updates then change to 1920. I have no decent way of knowing when I can reliably read this value.
Thanks I appreciate the suggestion but the device is not changing orientation. It's simply starting out with the full native and non-scaled device resolution that the iPhone 6S Plus has at 2208 width, but then changes to 1920. The Plus devices do some unusual hardware scaling which is probably the real root of this problem. I'm guessing that during the iOS application delegate launch phase, or perhaps while the splash/launch images need to be on screen it's rendering and reporting 2208, then when the OpenGL or Metal rendering view kicks off it's using 1920. In that small window is my problem. I'm happy to have a small delay before reading the value but I need to know when it's made the change, and to be able to have that code run in a way thats platform and device independent.
it might still fire, despite the device not being physically rotated then there is Code (CSharp): NSApplicationDidChangeScreenParametersNotification for default notification center..
I've been advised that the issue has been fixed in the 5.5 beta.. however I'm hoping Unity decide to back port the fix to the current stable version of Unity because no one can rely on use a beta for live production. It has far too much potential for volatile changes and to encounter other bugs, especially when you need to support multiple platforms. Otherwise I'm thinking this new beta release strategy could basically be back to the way Unity used to be a couple of years back where you had to wait months for a bug fix to make it in to the stable build.
Hey all, big thanks to Unity who back ported the resolution fix to 5.4.1p1. Confirmed that the fix is working well, cheers! Jason
UNITY 5.4.0 , Screen.width & Screen.height returning 960 & 640 respectively on iPhone 5 & 6, when tested on device. Also, the Default Splash Screen of UNITY is stretched or squeezed accordingly...