Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirrored display on Unity 2019 & iOS #1031

Open
spazzout opened this issue May 9, 2019 · 27 comments

Comments

@spazzout
Copy link

commented May 9, 2019

IMG_DBC131DD29E3-1

SPECIFIC ISSUE ENCOUNTERED

The GVR camera transform rotation is inverted on Unity 2019.
Only happens on iOS builds. Both with single and multi pass.
Locking orientation doesn't make a difference either.

HARDWARE/SOFTWARE VERSIONS

  • Unity: 2019.1.0f2
  • XCode: 10.2.1
  • Google VR SDK for Unity: 1.18.5
  • Tested on iOS 12.2: iPhone 6s plus, iPhone 8, iPhone Xs, iPhone Xs plus
  • Built on Mac mini: MacOS 10.14.4

STEPS TO REPRODUCE THE ISSUE

  1. Create a new unity project.
  2. Set target platform to iOS.
  3. Enable VR in build settings to import GVR package and add "cardboard" to devices.
  4. Set orientation locked to landscape left
  5. Build to iOS device and rotate it

ADDITIONAL COMMENTS

Other fixes i have tried (but don't work) include:

  • Inverting the camera rendering manually with GL, still the rotation applied to the VR camera is inverted.
  • Inverting the transform rotation of the vr camera every frame has the same result.
  • Setting different cardboard viewer presets by scanning their qr codes.
@spazzout

This comment has been minimized.

Copy link
Author

commented May 9, 2019

Installed GVRSDK pod is 1.170

@spazzout

This comment has been minimized.

Copy link
Author

commented May 10, 2019

So i tried downgrading the GVR iOS package from 1.18.5 down to 1.17 to match the podfile without improvement.

@futurnaingenieur

This comment has been minimized.

Copy link

commented May 11, 2019

Same issue here, build for Android:

GoogleVRUnityIssue

@niharsail

This comment has been minimized.

Copy link

commented May 16, 2019

Same thing happening with me.

@Rickleung

This comment has been minimized.

Copy link

commented May 17, 2019

Still no solution from unity?

@christougher

This comment has been minimized.

Copy link

commented May 23, 2019

Same Problems here for IOS. It seems IOS 12.2 and or Unity 2019 have this problem. IOS 12.2 seems to do this even with Unity 2018. Also same problems with Pixel 2 running Android 9.0

@christougher

This comment has been minimized.

Copy link

commented May 24, 2019

Seems to work fine under Graphics API OpenGLES3 but not Vulkan or Metal APIs...

@yazansorour

This comment has been minimized.

Copy link

commented May 29, 2019

downgrade unity to 2018.3.14f1 will works

@mariovski

This comment has been minimized.

Copy link

commented Jun 1, 2019

Go to player settings and remove Vulcan Api and stay with openGLES3.
It works fine now on 2019.1.2f1 and Android Huawai p20 lite and others.
https://computergraphics.stackexchange.com/questions/8185/what-are-metal-and-vulcan

@BinaryNate

This comment has been minimized.

Copy link

commented Jun 13, 2019

+1 for this issue. I'm unable to upgrade to Unity 2019.1 because enabling the Cardboard viewer in XR Settings causes the view to be upside-down on iOS. The issue is also described in this Unity forum thread.

@spazzout

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

Temporary fix
So we haven't heard back from Unity yet and needed to ship our game, my collegae came up with this script, attach it to your camera and it should render correctly on iOS.

FlipScreen.txt

@christougher

This comment has been minimized.

Copy link

commented Jun 13, 2019

Thanks so much for sharing this! Not seeming to fix it for me... Do we need to assign a material? I added it to the Main Camera in the HelloVR example scene but no change. Any other steps to follow? Thx again!

@spazzout

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

Forgot to share this too, add a material with this shader to the script and it should work
FlipShader.zip

@christougher

This comment has been minimized.

Copy link

commented Jun 13, 2019

Works great! Thx again.

@christougher

This comment has been minimized.

Copy link

commented Jun 14, 2019

Actually It appears that the left and right eye have about a 90 degree angle difference...

@eqrxjz

This comment has been minimized.

Copy link

commented Jun 17, 2019

I added to my project, works mostly fine, like @christougher mention, it has a disparity between cameras, maybe i can adjust that disparity in the script bottom section. i'll working on it, but by now it is the only workaround i found. Thanks! @spazzout

@juscelinotanaka

This comment has been minimized.

Copy link

commented Jun 18, 2019

I'm having the same problem. I am using the OpenGLES3 option for now. I can also add that when using Metal it keeps drawing a ScreenSpaceOverlay canvas over the inverted image while when using OpenGLES3 it doesn't show it (I know I shouldn't use it and/or expect it to work, I just made it for testing).

Before enabling VR:
IMG_7643

After enabling VR - notice that it now has a slight alpha transparency/color multiplier on the button:
IMG_7642

@paulgnz

This comment has been minimized.

Copy link

commented Jul 8, 2019

The Temporary fix above doesn't work with Metal. OpenGLES3 works however the performance is terrible.

Any suggestions?

@christougher

This comment has been minimized.

Copy link

commented Jul 15, 2019

Got an email from Unity QA...
"I have just verified the fixes and it should be available in the next released Unity version."

Not sure exactly which version(s) he's referring to... Hopefully 2018.4 as well as 2019.1...

@rusmaxham rusmaxham added the Unity bug label Jul 15, 2019

@alcristog

This comment has been minimized.

Copy link

commented Jul 16, 2019

Go to player settings and remove Vulcan Api and stay with openGLES3.
It works fine now on 2019.1.2f1 and Android Huawai p20 lite and others.
https://computergraphics.stackexchange.com/questions/8185/what-are-metal-and-vulcan

This worked for me!

@iamtheonly

This comment has been minimized.

Copy link

commented Jul 20, 2019

I'm using ARKit and Google Cardboard in my project. ARKit requires Metal, so I can't remove it and use GLES3 :(

I can confirm this does work in Unity 2019.3a, but then my project does not upload to App Store because of some Unity problems - "disallowed Frameworks", so I have to stick to 2019.1

Is this such a big issue that the fix can't be back ported to 2019.1 ? :/

@xinaesthete

This comment has been minimized.

Copy link

commented Jul 20, 2019

@iamtheonly have you tried the workaround scripts posted above?

@iamtheonly

This comment has been minimized.

Copy link

commented Jul 20, 2019

@xinaesthete yeah I did, and as someone posted it produces a huge disparity between the eyes. I haven't looked into the code too, maybe I can fix it myself.

I'm using cardboard for a 360 panorama viewer so I figured that simply flipping the texture upside down in the unity's panoramic shader will do (and it somewhat does - it displays correct!), but then when I build the app to the phone, the camera movement on X axis is inverted, so when I tilt the device down, the camera points upwards and vice versa.

@alcristog

This comment has been minimized.

Copy link

commented Jul 21, 2019

I got rid of any complication using the 2017 version for all my VR projects. This SDK seems not to work properly on 2019 versions...

@xinaesthete

This comment has been minimized.

Copy link

commented Jul 21, 2019

@iamtheonly ah ok. I haven't actually tried the workarounds I mentioned yet. I do see similar things with the transforms going the wrong, flipping a texture upside-down definitely not going to fix it (actually the app I tried it with is sufficiently abstract that you can only tell it's wrong because the movement is wrong).

FWIW it seems fine with 2018 @alcristog.

@pauluhn

This comment has been minimized.

Copy link

commented Jul 21, 2019

2019.1.10f1 doesn't seem to work with the flip hack. the left/right aren't aligned correctly.

@christougher

This comment has been minimized.

Copy link

commented Aug 1, 2019

I can confirm the fix is included in 2019.2. Building fine on iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.