googlevr / cardboard

Open source Cardboard SDK and samples
Other
1.49k stars 256 forks source link

No VR display on phone; no interaction #151

Closed rccDave closed 3 years ago

rccDave commented 4 years ago

Goal: Successfully build and run first Google Cardboard project

Outcome: Unity Build & Run put a running app on my phone, but it was a monocular view and had no interaction whatsoever.

Request: I'm out of ideas of what to try next. Looking for guidance or ideas. I've tried a dozen different things, watched several YouTube tutorials (unfortunately set for earlier versions that don't match what I have), and read some of the comments in this community.

Getting there: I'm following the QuickStart at https://developers.google.com/cardboard/develop/unity/quickstart

I got through all the bits and pieces. I had no errors during building.

Note: The demo apps that come with Google Cardboard are running on my phone just fine, so I know they phone is set for the viewer.

If there's something I can provide to aid in troubleshooting, I'm happy to provide it.

joaoborks commented 4 years ago

Make sure you enabled the Cardboard here and that Initialize XR on Startup is enabled. If with these settings it still does not load, check for error logs.

rccDave commented 4 years ago

Joao: Thank you for the suggestion. XR was enabled to initialize on Startup.

I've included some screenshots of the project settings. Perhaps you (or someone else) can spot something else I've missed. https://1drv.ms/u/s!Aj1o4tKebMPQiO4U8dMjyTPMgtDuLA?e=LA3TrB

(Is there a better or preferred way to put screenshots in this forum? The above link will expire in 3 weeks.)

As far as logs go, the Console showed a few where I was missing the .cs scripts from the demo. I copied those over and resolved all the problems but the last one in the linked zip file above. The remaining issue seems to be general: "..\android\repositories.cfg could not be loaded".

I saw a variety of supposed solutions for that, but they did not sound definitive.

Seems very close.

joaoborks commented 4 years ago

You left OpenGLES 3 instead of OpenGLES 2 on the Graphics APIs. Perhaps that is why VR is not working. OpenGLES 3 is expected to arrive at version 1.4 according to #40.

stefanrzv2000 commented 4 years ago

I have had the same problem and switching from OpenGLES 3 to OpenGLES 2 worked for me. I have to note that in Console Logs I had found "GL error 1282" and no other explanation.

rccDave commented 4 years ago

Good ideas.

I switched to OpenGLES 2, then rebuilt and ran. All Console errors are gone; only "success" messages left. Haven't seen any "GL 1282" references during this exercise, but will watch out for them.

If the demo built without errors and loaded on my phone, maybe I'm not looking for the right thing.

Here's a screenshot approximating what I saw on the phone and what I expected to see. For reference, I'm using a Samsung Galaxy s9, which does fine with other VR and AR apps. The Cardboard demo linked from their QR code works on the phone.

  1. I saw a full screen view of what the camera saw. No controls and no responses to tapping, swiping, pinching, etc.
  2. I expected to see the distorted VR binocular rendering of the scene set up for the Cardboard lenses.

Screenshot 2020-11-05 080937 (Pardon the scribble lines; mouse drawing; no stylus on this machine)

I have the "start in VR mode" checked. I did see a reference somewhere that this needed to be "woken up" somehow.

stefanrzv2000 commented 4 years ago

I have had the same issue right after switching from OpenGLES 3 to OpenGLES 2, but it appears I did not have the Cardboard plugin Checked in XR Plugin Manager. After checking that box, it worked just fine for me. CardboardChecked firts_VR

joaoborks commented 4 years ago

@rccDave check for error logs (in your device). It's the best way to identify what is happening with the XR loading process.

rccDave commented 4 years ago

Stefan: I have confirmed that I already have XR Cardboard and "on startup" checked. Joao: I'll do that after my next attempt.

Found a reference to a compatibility problem with Unity versions later than 2019.2. I was using 2019.4. I'm installing 2019.2 now to give that a try.

Thank you for continuing the suggestions.

joaoborks commented 4 years ago

I'm using the latest LTS version (2019.4.13f1), and it works as expected for Android and iOS. It just doesn't work with AR on iOS as described here

rccDave commented 4 years ago

Stefan: YES! That's the screen I expected to see. Haven't yet. (Still in the middle of my next attempt.) Joao: Hmm. Then what I had should have worked.

rccDave commented 4 years ago

So.... I got something working.

I abandoned the demo project (for now) and decided to try to build something from scratch. I followed this and other tutorials, but this one from Astire Games (https://www.youtube.com/watch?v=G5qAwWA2QlE&feature=youtu.be) had what I was looking for.

Observations relevant to this thread:

I have no interaction yet. That's next. But I have an object I can view in 3D VR through Cardboard.

Thanks for all your help. It was a group effort.

joaoborks commented 4 years ago

@rccDave I've made a Pull Request that adds most of the basic interactions for VR like Gaze Pointer, 2D camera rotation, VR Mode controls here: googlevr/cardboard-xr-plugin#13 Try it out! :)

jballoffet commented 4 years ago

@rccDave , it seems there is something wrong in your project settings, so I’d suggest that you carefully follow the steps described in the quickstart webpage. I wouldn’t suggest creating a new sample from scratch nor using the deprecated Cardboard plugin in Unity. If you’re still unable to run the sample app provided with the XR plugin, please reach out to us again, providing your sample project where the issue is shown, the steps required to reproduce it and details such as the phone being used, Unity version, etc.

rccDave commented 4 years ago

Joao: Thanks for the Pull Request. I haven't had a chance to check that out.

jballoffet: Thank you. Here's an update: I was able to get the demo project completely working, but I used the deprecated settings as described in the tutorial above. I followed the 2nd half of Astire's tutorial to load the demo project, then modify it. I used version 1.200.1 (instead of 1.3.0) of the demo from https://github.com/googlevr/gvr-unity-sdk/releases.

I don't like using things that say "deprecated", so this will need to be solved for v1.3.0 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.3.0.

I'll try again with a fresh Unity project soon using current versions of things according to the docs.

rccDave commented 4 years ago

jballoffet: Started fresh. Unsuccessful. Got stuck at the Package Import.
Following is the screenflow. You'll find a zip of the project here. https://github.com/rccDave/rcc-pub-git/tree/gcb-xr

Open Package Manager for URL link to GitHub U Pkg Mgr Url 9 Nov 20

URL string pasted. Ready to Add. Git XR Pkg before Add 9 Nov 20

Seems to process. Git XR Import in Progress 9 Nov 20

Errors indicate missing items that need to be retrieved manually. Stopped here because I believe that is not the intent. All the demo files should be in the project at this point. GCB XR Import needs manual help 9 Nov 20

Checking the Packages we see no demo scene, scripts or any of that needed for the demo. GCB XR after Git Url 9 Nov 20

joaoborks commented 4 years ago

@rccDave that's because you're probably used to the old "unity package" instead of using the Package Manager. To get samples with this new system, you have to open the Package Manager Window, search for the Google XR Cardboard package, and click Import into Project on the sample. Like this: image

The Package Manager does not load assets directly inside your project. Instead, it loads them as dependencies.

Next, make sure you enable cardboard on the XR Plug-in Management screen like this: image

And finally, you have to use only OpenGL ES 2 as the Graphics API (even on iOS where it says it's deprecated): image

Support for OpenGL ES 3 #40 is expected at next release 1.4 and Metal #11 later on 1.5. Let me know if you run into any more issues.

rccDave commented 4 years ago

@JoaoBorks, Thanks for sticking with me. I see all but that first screen. What am I missing?

I've been getting to Package Manager through Window for all of this thread. I don't even know where to find an "old Unity Package". Win Pkg Mgr 11 Nov 20

Then on to the Git URL for the plugin. Git XR Pkg before Add 9 Nov 20

This does result in import progress that looks promising, but I do not find the Google Cardboard plugin to import within the Package Manager. I did searches for "google" and "cardboard". The only entries I see are under Google and don't include "cardboard". Google Pkgs after Git URL 11 Nov 20

(Note: I also tried to load from disk. I choose the package.json file.)

However, your other screens I do see (and have throughout this attempt).

In Packages... GCB listed in Asset Pkgs after Git URL 11 Nov 20

(...but it's not all there; no scenes, etc.)

The Cardboard plugin checkbox... GCB XR Plugin Proj Settings checked 11 Nov 20

The GLES2 setting... GLES2 checked 11 Nov 20

I feel like if we can figure out why I'm not seeing the plugin to import in the Package Manager, then it would work.

Thoughts?

joaoborks commented 4 years ago

@rccDave on your Package Manager window you can see on your dropdown it is written Unity Registry. In order to see the packages installed in the project, you need to select In Project just like my screenshot: image

The "old Unity Package" I mentioned was the old way to import 3rd-party plugins and stuff through .unitypackage files, that we are no longer using for this plugin.

rccDave commented 4 years ago

@JoaoBorks THAT's IT! Mystery solved. Thank you, thank you.

I see this thread is listed as "bug". It's not. It's plain, ol' newbie user error.

After finding the import, I was able to follow the rest of the Quick Start and run the HelloCardboard demo.

Here are some points that could improve the Quick Start page, if someone is so inclined. https://developers.google.com/cardboard/develop/unity/quickstart

Questions:

  1. What is the purpose of scanning the QR code on the GCB?
  2. Are there different versions with different lenses needing different camera and lens distortion settings?
  3. Is it tracking me back to Google in some way?
  4. If I wanted to do a straight two-eye, binocular split screen with no distortion, is that just the stereo setting I think I saw somewhere with no special plugins?
joaoborks commented 4 years ago

Nice job! I think @jballoffet or @chaosemer can clarify your questions better than anyone else since they are the official devs.

whizzkid commented 4 years ago

@rccDave 1: see question 2 2: yes :)

The qr code is printed on (some of) the google cardboard compatible viewers. it contains a link to the settings for those glasses for distortion, eye distance and stuff like that. so that the vr-app can display your game properly. More info and generate your own if you make your own viewer: https://wwgc.firebaseapp.com/

3: seeing that it's a link, yeah you'll probably be tracked in some way when you scan it. 4: I can't answer this one unfortunately

jballoffet commented 3 years ago

Replying to @rccDave questions:

Given that the reported issue is solved by now, I’m closing it.