How does OpenVR, SteamVR and Unity3D work together? - unity3d

I am trying to understand the VR platform stack of Vive, and how it's games are developed.
I am struggling to understand where exactly does openVR, steamVR and Unity fit into picture.
My understanding so far has been that:
openVR - Hardware independent layer providing APIs for peripheral access.
That is it can provide access to either Oculus or Vive hardware via
a defined interface.
SteamVR - Provides access to hardware to games developed either in unity or
unreal.
Unity3D - A game engine to develop games.
If anyone can correct me, I will be much grateful.
Or if my understanding is correct, then why can't games being developed in unity 3D access hardware directly via openVR.

OpenVR is an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting (ref1), SteamVR is the customer facing name that we use for what users actually use and install (for details check this video: Using Unity at Valve)
Also Check to see that can you use the Vive with OpenVR without Steam ??.
Lets finally look all these terms, thanks to Reddit post:
How a Game Appears on your Head Mounted Display(HMD):
A game renders an image, sends it to it's corresponding runtime. The runtime then renders it to the HMD:
Rendered Image using the :
[OVR/OpenVR] SDK -> [Oculus/SteamVR] Runtime -> [Rift/Vive]
SDKs:
SDKs are used to build the games. A game can either implement OVR or OpenVR or both. This means that the game has access to native functionality in it's corresponding runtime. SDKs do not handle async timewarp or reprojection, those are handled by the runtime!
OVR: Made by Oculus for the Oculus Rift. Current version (14th May 2016) is 1.3.1 and can access all features of the Oculus runtime.
OpenVR made by Valve and supports Vive and Rift via the SteamVR runtime
Sidenote to SDK's and Unity games: Unity 5.3 currently has optimizations for VR in their native mode. The native mode supports Rift, Gear and PSVR, but not SteamVR. A game compiled with Unity 5.3 can use those optimzations with the Oculus SDK but not the OpenVR SDK. The OpenVR SDK has it's own optimizations, which may or may not result in similar performance. However, the upcoming Unity 5.4 will support SteamVR natively and performance should be more or less identical. Please note: this is Unity specific and other engines might have similar or different optimizations for some or all headsets.
Runtimes
Oculus Runtime responsible for async timewarp and handles device detection, display, etc. It (the runtime service) needs to be running for Oculus Home to launch
SteamVR Runtime responsible for reprojection and supports Rift and Vive
Software Distribution Platforms
Oculus Home needs to be running for the Rift to work. By default only supports apps from the store (checkbox in the settings of the 2d desktop client to enable other sources). It downloads games and runs them. It also handles the Universal Menu on the Xbox button
Steam/SteamVR technically does not need to run when launching OpenVR games, but highly recommended (room setup and config is pulled from there). Also handles overlay menu on the Xbox button, or when running on the Rift, it launches by pressing the select/start button in the Oculus Universal Menu
Finally worth reading.

Related

Can I use Steam VR interaction system scripts with XR toolkit?

I am converting a SteamVR standalone build into an XR toolkit android build for the Oculus Quest 2. I need it to work without using quest link. Several scripts I use (like circular driver) are in the SteamVR interaction system core library. I was wonder if there was a way to continue using some of the scripts or is it more worth my time to rewrite them for myself?
I've read the documentation for XR toolkit and it seems incredibly lacking compared to SteamVR

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

Will a mixed-reality application and experience developed for Hololens 2 using Unity work on Oculus Quest as is?

To allow sales people to meet clients in the COVID19 era without travelling, busienss wants to create a virtual meeting room .
The clients will get Oculus Quest as Hololens is hard to procure right now where as business wants to use Hololens on their end.
Will an application /experience created for Hololens using Unity work as is on Oculus Quest or does it make sense to have the same device on both end?
I am new to this area, so not sure if this question makes sense, but is it something like developing 2 versions of code, one for iOS and one or Android and using something like Xamarin to make the process easy ?
Does Unity have features to make applications compatible between Hololens and Oculus Quest ?
MRTK makes it easy to make multiplatform XR applications.
https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/GettingStartedWithTheMRTK.html
Unity will allow you to run most applications on both Windows on ARM (HoloLens 2) and Android (Quest).
MRTK even has hand tracking support on both platforms.
https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/CrossPlatform/OculusQuestMRTK.html

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/).

Should I enable VR support for google cardboard in Unity

I'm creating my firs VR app i unity for google cardboard. I noticed VR support setting in the inspector. I searched a little bit and it isn't clear for me if I should enable it for google cardboard. Here is the link for unity manual about it. Thanks for help!
For a while you should not enable VR support since Unity has no native support for Cardboard yet, although it was announced on Vision Summit 2016 for future versions.
By now, you should only use the Unity package with the appropriated prefabs for Google Cardboard available at https://developers.google.com/vr/unity/download.
You dont need to check Virtual Reality Supported to make an app for Google Cardboard. Make sure that you download the Google VR SDK for Unity and bring it in your assets folder in your project. Then just search for GVR Main in your assets folder and bring that into your project scene and you are good to go. Also you may not need the default camera in the scene as well. Just create your scene and your build is automatically supported for Google Cardboard. VR Supported is largely for computer dependent devices like the Oculus Rift and not apps that you run on your mobile phones.