Closed rccDave closed 3 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.
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.
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.
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.
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.
(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.
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.
@rccDave check for error logs (in your device). It's the best way to identify what is happening with the XR loading process.
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.
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
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.
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 did not install cardboard-xr-plugin-1.3.0, which I had in the Cardboard demo according to their docs. Astire's tutorial simply checked Virtual Reality Supported in Deprecated Settings (I know) in Player Settings, then selected Cardboard.
Astire said only 2019.2 would work. I ignored that and went with 2019.4 because of what Joao said above.
I did nothing special with the camera. It was simply a default camera. In other tutorials, you have to delete that one and replace it with some XR camera.
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.
@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! :)
@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.
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.
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
URL string pasted. Ready to Add.
Seems to process.
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.
Checking the Packages we see no demo scene, scripts or any of that needed for the demo.
@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:
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:
And finally, you have to use only OpenGL ES 2 as the Graphics API (even on iOS where it says it's deprecated):
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.
@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".
Then on to the Git URL for the plugin.
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".
(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...
(...but it's not all there; no scenes, etc.)
The Cardboard plugin checkbox...
The GLES2 setting...
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?
@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:
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.
@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
Add the part about setting Project Manager to "In Project". I took the long list to be everything of the "Unity Registry" to be everything. When I didn't find "Google Cardboard XR Plugin...", I thought it wasn't there yet... but it was.
Android references were lost every time. Edit > Preferences is the place to that. I found that after watching Astire's vid. Here's the spot: https://youtu.be/G5qAwWA2QlE?t=139
Questions:
Nice job! I think @jballoffet or @chaosemer can clarify your questions better than anyone else since they are the official devs.
@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
Replying to @rccDave questions:
cardboard
and cardboard-xr-plugin
do not collect any data that is tracked by Google. However, when a QR code is recognized during scanning, these libraries make multiple web requests to retrieve the Cardboard viewer device parameters. The specifics can be seen in QrCodeContentProcessor.java.Given that the reported issue is solved by now, I’m closing it.
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.