I've been trying to build a VR application and they have all generally worked out for me. I've tried adapting another game of mine to VR by adding VR support. I've added my S6 (and S7 on a separate occasion) oculussig file too. When I plug into the GearVR it asks for permissions then goes to the Unity Splash screen (as expected). Immediately after it will do one of two things:
1) Just go straight to a black screen. The game is running because i can hear the audio and responses to the touch pad. Or, 2) Flash the game for one or two frames, then goes to the black screen described above (game running in background).
Has anybody encountered this issue before? I can't figure out what it could possibly be. I've tried various versions of Unity (final, patched, beta: 5.3.4p3 and 5.4.0b17. I've placed the Oculus patch files into the correct directory as is described on Oculus site.
Does the issue occur with 5.3.5f1? That version has a much newer Oculus integration. If you still see the issue there, please send logcat from the start of the process to the time you see the black screen. It is probably encountering an error.
I've just tried with 5.3.5f1 and the problem has persisted. I downloaded a logcat reader (CatLog) and there is an error occurring, though I don't know where and when (inexperienced working with mobiles natively). What would be the easiest way for me to send it in?
But the application requires the device to be plugged into the GearVR. Does logcat keep running in the background on the phone until you plug it back into the computer?
08-08 22:07:07.508 6289 6304 E Unity : [EGL] Failed to create window surface: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation.
08-08 22:07:07.508 6289 6304 I Unity : Skipped rendering frame because GfxDevice is in invalid state (device lost)
The log is actually really long, but it keeps repeating "[EGL] Failed to create window surface: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation." and "Skipped rendering frame because GfxDevice is in invalid state (device lost)".
Thanks for the logcat. This looks like a known issue with 5.3.5p1 and earlier, where the Oculus mobile SDK would hijack the windowsurface for VR rendering (as usual), but Unity would try to use it while its context wasn't current on the windowsurface. Starting with 5.3.5p2, Unity explicitly manages the windowsurface and doesn't have to assume its context is current on it when it isn't. Can you try upgrading?