Search Unity

Change FOV in 5.4* on Vive via script gone?

Discussion in 'AR/VR (XR) Discussion' started by mechangel, Sep 7, 2016.

  1. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    We are no longer able to adjust the FOV on the VR Camera after updating to 5.4 for the Vive version of our app. It does work with Samsung Gear however.

    Was this FOV control removed on purpose by Unity, or just change in some way I'm not detecting, or is this a bug with Steam VR?

    Here is an example of the things we were doing with it:
    Code (CSharp):
    1.     public float IncrementForFOV ()
    2.         {
    3.             float fov = thisCamera.fieldOfView;
    4.             float extentFOV = (targetFOV < thisCamera.fieldOfView) ? maxFOV : minFOV;
    5.             float x = ((Mathf.Pow((defaultFOV - fov) / (defaultFOV - extentFOV), 2f) + 0.1f) / 1.1f);
    6.             float dir = ((targetFOV - fov) / Mathf.Abs(targetFOV - fov));
    7.             return dir * x;
    8.         }
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    This looks like it might be an issue with Steam VR. We are changing the FOV internally but what is rendered to the display is using the old FOV. We will investigate more and get back to you.
     
  3. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Thank you so much for your response, my studio recently released to Steam Early Access using 5.3, and are unable to update with more content after updating! Here's hoping there is a solution soon.
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    There is a good chance that this "broke" in 5.4 because of updated OpenVR libraries. Changing FOV in VR mode may cause issues with motion sickness when looking through the VR headset. We tested Vive using OpenVR, Oculus using Oculus and OpenVR and Gear VR. GearVR and Oculus using Oculus Home both allowed FOV changing while Vive and Oculus using OpenVR did not.
     
  5. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Yes, it can certainly cause motion sickness when used improperly. There are many tricks to counteract this neurological response by use of blur shaders, tunnel blinders (like in the Ubisoft Eagle demo), and of course letting the user control when to zoom and never doing it unexpectedly. I know it wasn't perfect in the initial release, but most of our mixed reviews are due to lack of content, with some complaints about the transition FX.

    I'd like to continue to experiment with good ways to simulate zooming into a new degree of magnification power (this is a science app, not a game per se) but want to keep the benefits of being on the new version of Unity at all times. Is the word "broke" being used to say this is now by design, and I might need to make a feature request instead of a bug report? I feel it's a bit heavy handed for them to make design choices for devs by limiting the plugin - especially so early in our VR pioneer days!

    Edit: Actually, if it's OPEN VR that is the FOV problem... at least it's OPEN! Someone at work just reminded me of this fact.
     
    Last edited: Sep 7, 2016
  6. JasmineJas

    JasmineJas

    Joined:
    Jun 2, 2016
    Posts:
    9
    I just got this working (Thanks for making this available btw!). Joost, the cursor objects should be disabled until you have a successful raycast hit with a canvas - so don't disable the event system. Try this: I juts copied VivieControllerInput.cs and UIIgnoreRaycast.cs into my existing project, added the Input Module to my Camera Rig and attached the ViveControllerInput script to it (cursor scale is at 0.0001). Make sure you do not have another event system in your scene.
     
  7. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Is this in regards to overwriting the FOV controls? I posted on the Steamworks forums as well trying to figure out what the deal is.