1
\$\begingroup\$

Has anyone ran into this?

I'm on Unity 5.1.1p3, Cardboard Unity Integration v0.5 (5/28/2015) and an iPhone 5 running iOS 8.3 (12F70).

I made a game that uses Cardboard and on an iPhone 6 the screen renders as expected: two offset cameras. On an iPhone 5 however, while the screen does show the 2 viewport masking and the distortion correction, it's actually a single camera that is being rendered, defeating the purpose of Cardboard.

Here's what I mean. This is the iPhone 6, as expected: enter image description here

And this is the iPhone 5, which is wrong: enter image description here

Any ideas?

Some extra info:

The iPhone5 can only use GLES2. It doesn't support ES3 or Metal. But what I did notice is that if I make a build for GLES2 the first time the app runs on the device (be it iPhone 6 or 5), when the Cardboard camera gets enabled, the app crashes: enter image description here

If then I quit the app and start it again from the phone without it being hooked up to Xcode, on the iPhone5 I get the wrong rendering I've shown while in the iPhone 6 the app just crashes again. And if instead I make my build with automatic graphics API detection, what happens is that on iPhone6 it goes to Metal mode and so it works fine and on the iPhone5 it goes to GLES2 mode which, as stated before, crashes if attached to Xcode but otherwise just runs only that with the wrong rendering.

\$\endgroup\$
  • \$\begingroup\$ Which SDK (and version) are you using? Any interesting messages in the logs (errors, warnings) from the SDK? \$\endgroup\$ – smd Jul 18 '15 at 3:47
  • \$\begingroup\$ @smd I just updated my question with versions of all the things involved. Basically I'm on Unity 5.1.1p3, Cardboard Unity Integration v0.5 (5/28/2015) and an iPhone 5 running iOS 8.3 (12F70). And I'm not getting anything weird in the console logs. So far the only difference is the iPhone 6 is using the Metal API while the iPhone 5 is using GLES2. \$\endgroup\$ – SaldaVonSchwartz Jul 18 '15 at 23:15
  • \$\begingroup\$ As a test, force the iPhone 5 to use Metal (in Player Settings), and vice versa, force the iPhone 6 to use GLES2. That will indicate whether it is the graphics API that affects this. (The Cardboard SDK by default uses two different distortion correction methods, one for Metal and one for OpenGL.) \$\endgroup\$ – smd Jul 19 '15 at 0:30
  • \$\begingroup\$ the iPhone5 can only use GLES2. It doesn't support ES3 or Metal. But what I did notice is that if I make a build for GLES2 the first time the app runs on the device (be it iPhone 6 or 5), when the Cardboard camera gets enabled, the app crashes. See the extra info I added \$\endgroup\$ – SaldaVonSchwartz Jul 19 '15 at 0:54
0
\$\begingroup\$

I found the issue. Though I'm still not 100% sure why this is so. But it turns out that if using GLES2 and using any post processing / screen space effects from Unity, I have to switch the Cardboard SDK's direct rendering mode off. Doing that (or alternatively not using post processing at all on the cameras) makes the game render correctly on GLES2.

A separate issue that still remains is why the first time I attempt running a fresh build from within Xcode, the app will crash while creating the render buffers. After that initial crash, starting the app subsequent times from within the springboard does not crash.

\$\endgroup\$
  • \$\begingroup\$ Yes, the direct render flag should be set to false when you use image effects. Most image effect shaders assume they have the whole screen space to work with, but for side-by-side stereo that is obviously not the case. \$\endgroup\$ – smd Jul 19 '15 at 7:30
  • \$\begingroup\$ Right but the whole direct mode is still weird: if using GLES3 or Metal, disabling direct mode crashes the app. So I had to end up writing code that detects the graphics API and based on that switches the direct mode on/off (if ES2 off else on). Another thing that I'm confused about regardless is: shouldn't disabling direct mode allow me to put a single screen space fx in the main cardboard camera and the 2 eye cameras would then just clip at different portions of the main and be done? Not sure why I still need to duplicate the effects if using indirect mode. \$\endgroup\$ – SaldaVonSchwartz Jul 22 '15 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.