Is screen.width for the 6 plus 1920 or 2208?
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.
Yes, apparently you should target 2208 size. See this handy link here
But can it downscale? If I build sprites for 2208, then what of iPhone 5 & 4S?
Native resolution of iPhone6+ is 1080p. This page explains it quite good. 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. ![]()
Try to make a screenshot. I’ve read that screenshots are 2208x1242
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. Seite 2: Ver-6-te-Ansichten | heise online
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.