Is it possible to enable Unity native VR mode for a given SDK (let’s say cardboard) and render in mono mode (like in a non-vr app, with a single camera output across the screan instead the ‘left-eye, right-eye’ style).
Specifically what I need for my app is to use the gyro input to rotate the camera but in a non-vr app. In the future I might need to change from non-vr to vr render mode.
Camera is rotating properly but something weird is happening when running from the handset. It seems to apply a kinda zoom (I guess decreasing FOV though setting a different FOV at runtime changes nothing) and it also distort the image. The funny thing is that if I lock the handset and then resume the application then camera is working nice, with no distortion neither zoom (see screen captures at the bottom)
Any idea about what is happening and how it can be resolved?
Before lock the app:
As you can see the image is stretched across screen diagonal.
You can try to fix it by resetting the camera matrix. Though Unity currently has quite some bugs in GVR.
On iOS this rotation isn’t even correct. In the app we’re creating the Z axis gets rotated when entering VR etc.
I’ve talked about it in some other thread as there are a lot of threads with ppl trying to get to use GVR right. But it is mostly because of bugs that things are not as developers want them to be. Would be nice if the bugs got fixed, ever since release of 5.6 native integration it has been buggy.
Thanks. I found that calling to ‘camera.ResetAspect()’ after setting VrSettings.enabled to false seems to set camera with the proper FOV and no distortion
Hi everyone, so I just found this and wanted to try it myself, 'cause I want a non-stereoscopic view with head tracking applied, but it doesn’t work. The Video is “frozen” and I can’t move around. Any ideas why this could be?
public class test : MonoBehaviour {
// Use this for initialization
void Start () {
VRSettings.enabled = false;
Camera.main.ResetAspect();
Camera.main.GetComponent<Transform>().localRotation = InputTracking.GetLocalRotation(VRNode.CenterEye);
}
// Update is called once per frame
void Update () {
}
}
Problem with this approach is before screen is loaded, view isstereoscopic, because changes happen only on Start or OnEnable methods. How can I disable stereoscopic view from the beginning? I don’t want to use it at all.
As Unity try to load a proper SDK for your available devices as ordered in the list it always will load ‘None’ so, when you launch your app, stereoscopic camera should be disabled (the same for any VR behaviour). From here you can set up the vr behaviour (stereo camera, head tracking…) at your will.
Keep in mind that, at some point, you will need to load your VR SDK. This can be done with XRSettings.LoadDeviceByname (VRSettings.LoadDeviceByName in older unity)