IanPhilips / UnityOculusAndroidVRBrowser

3D browser based on GeckoView and Oculus SDK for Unity projects built on Android (Oculus Go/Quest, maybe GearVR)
MIT License
225 stars 63 forks source link

Decouple from OVROverlay #16

Closed NoviaDroid closed 4 years ago

NoviaDroid commented 4 years ago

The webview is rendered by OVROverlay, and it will always render in front of everything else (overlay is in front of eye texture)

So when converted the scene to use controllers input instead of gaze, the controller is always looks behind the webview, and looks wired.

And because this is based on oculus sdk, it is hard to use in other mobile vr platforms such as daydream and pico.

Maybe there is a way to get rid of oculus sdk?

IanPhilips commented 4 years ago

You can use other OVROverlays (up to 15) to render over the browser's.

With respect to the sdk: https://github.com/IanPhilips/UnityAndroidVRARBrowser/issues/8#issuecomment-625343189

NoviaDroid commented 4 years ago

Yes,but it will be wired if render a controller as a overlay? It would be 3D look -> 2D look? I haven't tried it yet.

IanPhilips commented 4 years ago

mmm yeah true, I believe the OVROverlays can have other shapes than quads at least but not sure which.

CallumFerguson commented 4 years ago

You can also use a OVROverlay with the Current Overlay Type set to Underlay. This will render under everything which means you will not see it, but there is a built in shader to punch through the screen to show the underlay. The result is the OVROverlay functions just like if the Geckoview was rendered to a texture on a quad.

https://developer.oculus.com/documentation/unity/unity-ovroverlay/?locale=en_US

IanPhilips commented 4 years ago

If that works that would be excellent! Thanks for the tip. Hopefully the punched hole in the screen still allows other things closer to the cameras to be seen.

CallumFerguson commented 4 years ago

It does work. I am currently using that in my project and you can't tell that it isn't a a quad with a texture.

IanPhilips commented 4 years ago

Beautiful, it seems like the demo should have separate underlay and overlay scenes. If you configure it in an "underlay" scene and submit a PR I'd be grateful. Alternatively you could detail the steps in the README and submit a PR.

CallumFerguson commented 4 years ago

Submitted pull request. Several files files changed automatically even when opened with the correct version of Unity. Hopefully that doesn't mess anything up.

IanPhilips commented 4 years ago

Nice work! I just confirmed things are working correctly, thanks!