BananaHemic / gamelodge_unity

Official fork of Gamelodge: where everything is made by users
https://gamelodge.xyz
11 stars 4 forks source link

F2 Always seems to load Oculus instead of OpenVR #1

Open andybak opened 4 years ago

andybak commented 4 years ago

ToggleVRMode() in VRSDKUtils has the following logic:

        if(_prevSDK == SDK.OpenVR)
        {
            newSDK = SDK.OpenVR;
            UnityEngine.XR.XRSettings.LoadDeviceByName("openvr");
        }
        else
        {
            newSDK = SDK.Oculus;
            UnityEngine.XR.XRSettings.LoadDeviceByName("oculus");
        }

So - we seem to only ever load openvr if it's already been loaded before? But how does it get loaded in the first place?

BananaHemic commented 4 years ago

When launched from Steam you have the option to run Gamelodge in Desktop, Oculus, or OpenVR mode. This corresponds to a launch command of vrmode=oculus or vrmode=openvr. We might want to add some shortcuts so that you have the same set of options with Itch

andybak commented 4 years ago

I was running within Unity. What's the simplest way to simulate those command line switches in the editor?

andybak commented 4 years ago

(Might be worth adding this info to the repo readme)

BananaHemic commented 4 years ago

Yea, I should add this info somewhere. To simulate this in Unity, you'll want to check out the XR settings under project settings->Player. Just drag to the top the VR SDK that you want to test with

andybak commented 4 years ago

Just drag to the top the VR SDK that you want to test with

Hmmmm. I thought I'd tried that. It seemed to default to "none" and I had to edit the source. Maybe it was user error...

BananaHemic commented 4 years ago

Yes, "none" is desktop mode. Lmk if dragging Oculus/OpenVR to the top doesn't do what you expect