Unity: how to embed a VR Cardboard game into a website - unity3d

Right now, I think there is not a way to do it within Unity. This is what I have found so far (please, correct me if I'm wrong):
The most popular VR plugins compatible with Unity for both Android and iPhone are Durovis Dive SDK and Google Cardboard SDK.
I have read that most Android phones are compatible with those VR plugins. My experience is that just a few are compatible. Durovis Dive SDK seems to be the most compatible one nowadays. If the Android phone has not gyroscope and the game has the Google Cardboard SDK plugin, the game won't load or crash. If the Android phone has not gyroscope, the game will load but the image will be still when we move the phone.
Unity 5.3 has been just released. It includes WebGL support. It includes VR support. Samsung Gear and Occulus are supported. However, I have not found out anything about the compatibility with others Android or iPhone devices. Maybe it works (I have not test it. I have not found somebody who has test it yet).
Here there is a list with VR technology for the web.
We can find stuff to Export an Unity scene to Three.js. Scripts and animations don't seem to work though.

I just spoke with an industry leader in VR experiences for media companies a couple weeks ago. And his company was one of the first to attempt VR in a web browser through mobile. He said it didn't work very well. He was partially successful, but if his company had problems, I'm guessing it's still a few years off. He said new additions to HTML are coming that will improve this over the next few years.
Hope that helps!

could you try WEBVR
YouTube Tutorial: Demo WebVR Unity
Although it has some defects, but it can serve you for basic applications. I was testing it with 360 videos, this was very heavy for the platform.

You may try WebXR. But you can't add both SDK at the same time.

Related

Best way to make my HoloLens 2 app run on smartphones

currently I am working on a project designed for the Hololens 2 using MRTK.
Now I want to make this app run on a mobile device (more specifially, an Android Smartphone) like any other AR app. Eventually these two should be able to communicate with each other. What would be the best way to go about it? The following ideas crossed my mind:
Copying and adapting the current scene made for Hololens by replacing Hololens exclusive features with ARCore features.
Creating a new project just for the mobile app.
Would love to hear your suggestions and ideas, thanks!
MRTK supports a wide range of platforms, including mobile devices such as iOS and Android. You can use the MRTK API directly on your Android device instead of ARcore. For how to configure MRTK for iOS and Android please refer to this link:Configure MRTK for iOS and Android [Experimental]

Is there a way I can test an Augmented Reality app on a phone that doesn't support ARCORE

I have a Xiaomi Redmi Note 8 Pro and it doesn't seem to support ARCore. I found some ways to dodge this but it appears to be quite complicated nor very safe.
My question is:
What other tools would you recommend if I want to create an app in Unity that also needs to use GPS modules, maybe altimeter and of course camera (AR stuff)?
I heard about Vuforia that might do the trick, also read something about AR Foundation from Unity. But to me, it looked like depending on chosen deployment it use AR Core or AR Kit(even Vuforia).
Any clearance about this maybe?
I suggest you don't try messing with your device. It doesn't support ARCore for good reason. And maybe you just try to use Android Studio Emulator, but Alas for some unknown reason, i try it but APK which is generated from unity can't be installed on the Emulator. Some stuff with the architecture
If you want to use Unity anyway. I suggest you use Vuforia. It works on most modern devices and doesn't even need device to test, just hit unity play mode and you can test around from your PC (need webcam).
Vuforia Engine provides a simulator mode in the Game view that you can activate by pressing the Play button. You can use this feature to evaluate and rapidly prototype your scene(s) without having to deploy to a device. (Source: https://library.vuforia.com/articles/Training/getting-started-with-vuforia-in-unity.html)
For Unity with ARFoundation, you can't use your PC like Unity with Vuforia, you need ARCore/ARKit supported devices.
Last if you want AR with GPS Modules (although this is not with unity) checkout AR.js https://github.com/AR-js-org/AR.js

Unity3d 5.5 Enable Vr for Cardboard

I'm almost new to Unity3D, I've watched this presentation of Unity evengelist made in February 2016:
https://www.youtube.com/watch?v=pK0ZD53gOoE
Evengelist said and showed that to bring project to VR you need to select one checkbox (Virtual Reality Supported). Now in 5.5 version just downloaded, when I select Virtual Reality Supported it says also "you must add at least one VR SDK", also after that checkbox selected when I click play scene, I do not see two eyes screen, just ordinary view. When last year I tried to make VR for Cardboard and loaded Cardboard SDK, scene view showed two screens to each eye in play mode.
So the question - how now make VR that works on Cardboard in Unity3d? Do I still need Cardboard SDK (I don't need magnet input support or similar, just stereo and head movement support)?
Added: I don't have Cardboard SDK option in Unity somehow:
According to Unity Blog, Cardboard support is exclusive to Android only. iOS Cardboard support will be added soon.
Do I still need Cardboard SDK
I don't think you need the SDK. This is now Native support for Cardboard. Although,you can still download the Cardboard SDK and Unity will automatically use it.
And here is how to enable Cardboard SDK in Unity 5.5.
Thanks Programmer for your answer, it helped me find what my issue was. However, I've spent literally all of my time over the past few days trying to get Google Cardboard and Unity setup, so I figured I can at least post my answer too.
One problem I initially ran into was that I was trying to use GVR Unity SDK v1.1. There are several bugs in this version, so I reverted back to the GVR Unity SDK v1.0.3. This can be downloaded from the github repo: https://codeload.github.com/googlevr/gvr-unity-sdk/zip/f391c2436426857899af1c37f0720b3985631eb3
Then, I ran into multiple problems just getting things to run on android, so I found that I have to use build tools version 24.0.1. This can be downloaded using the Android SDK Manager executable.
Lastly, the "cardboard" option wasn't appearing for me as part of the drop downs, just like in the picture posted by the asker. The problem was that I was using a regular version of Unity, when I needed to actually be using the technical preview. This can be downloaded from https://unity3d.com/partners/google/daydream, and I'm running Unity v5.4.2f2-GVR13.
Then the drop down "cardboard" appeared, and I was able to follow google's official instructions (https://developers.google.com/vr/unity/get-started) and get things set up.
I ended up installing the Unity 5.6 Beta and got my Cardboard app built quite simply using the EasyMovieTexture store asset, turning on VR in Player Settings and adding Google Cardboard. It is working great in IOS and Android. I am working on turning off the Google Overlay as my app toggles between Cardboard and a simple 360 view and that is a proving a challenge. It seems from what I have read Google does not want you to turn off their overlay. I might try to do this natively on IOS.

Understanding VR ecology

I have background in android and have developed few apps of my own. Now I want to explore VR app development for android. Going through forums etc., first thing I understand is that I need to have basic infrastructure like unity 3d sdk, cardboard sdk, cardboard device etc. I am not able to understand roles these individual components play in overall bigger picture.
Like, why do I need unity 3d sdk if I have android sdk and cardboard sdk, and android studio as dev environment?
Then, if I plan to develop for something like Oculus then what all sdks and devices are needed, and which programming language I can work with?
Your options depend on which device you'll target:
Game engines like Unity: You need Unity and some plug ins and of course the device you will target too:
Google Cardboard / Daydream
Samsung Gear VR
From scratch application: Your language is java and you need to download the sdk for your target device:
Google Cardboard / Daydream SDK
Samsung Gear VR, Oculus Mobile SDK
Regards
I think there is a lot of promise in web-based VR. Of course, the app will not be as high fidelity as a native application built in Unity or Java but you get the benefit of being able to target many platforms out of the box. ReactVR is a cool project coming out of facebook that is making it easier and more performant to build VR apps with web technologies.
Here is a cool starter-kit that can help you get started if you are interested: https://github.com/scaphold-io/react-vr-graphql
P.S. GraphQL is a great tool for enriching your VR apps with data no matter if you're building it with React, Unity, or Java.
You can check out A-Frame (https://aframe.io), a web framework for building VR experiences. It's been out over a year and has a strong community and ecosystem. With web-based VR, you get cross-platform support across Rift, Vive, Cardboard, Daydream, GearVR out of the box. With A-Frame, you get all of the boilerplate with a single line of HTML. You just have to grab a VR-enabled browser.
A-Frame's architecture is similar to Unity's, entity-component, but A-Frame makes it declarative and similar to web development. With effort, the fidelity can rival native (https://blog.mozvr.com/a-painter/).

Multiplayer game using unity free version for Android

I am going to start my first game on unity which is a real time multiplayer game for android. I want to ask few things.
Do I need to buy pro version or any license for the whole process (from development to submission to play store, I know that splash screen can not be change). My game is almost like 8 pool ball with all multiplayer features (create user profile, play with friends, play with Facebook friends, challenge friends, leader board filters etc etc) like in 8 pool ball. I am planning of using Photon for multiplayer.
I also need the Web and Facebook version as well in future.
I also see few pages about this but I am still confuse.
Thanks in advance.
The Unity3D personal version does NOT support C# sockets on mobile, so no 3rd party realtime plugin, neither Photon nor any other, will work on Android (or on iOS) with the personal version of Unity3D, but they all require Unity3D pro.
There is only one exception to this: PUN+ works even with Unity3D Personal on Android and iOS, because it applies a fallback to use C++ sockets through a native plugin on platforms, on which C# sockets are not available in Unity3D Personal. However, this is only true for PUN+ (Photon Unity Networking Plus), not for PUN (Photon Unity Networking).
Unity in Version 5 has no engine-specific pro-Features anymore. So basically free = pro (besides some services and splash screens). So you can go with Unity 5 free and e.g. Photon.
Regardings costs: It could be that you need some sort of webservice for your game (managing profiles etc.) so the webserver could produce some costs. But for getting started there are many free services out there like https://www.heroku.com/
Furthermore you will need to pay the 25$ fee for Google Play to publish the game.