How to change FOV for Oculus DK2?

Hi

I’m trying to change the FOV settings for DK2 using these settings;

These settings worked before on DK1
but now it doesn’t make any difference

Is there way to change FOV settings in Unreal Engine 4.4 and above for Oculus DK2?

thank you for your help
Samat

Hi Samat -

The command to change to FOV has changed a little bit since the original Oculus DK1. There’s now separate horizontal and vertical FOVs that you have to set.

To tweak it at runtime in the console, you have to first enable developer mode:
OCULUSDEV ON

And then you can set the horizontal and vertical FOVs with:
STEREO HFOV=90 VFOV=90

Please be careful with those though! The FOV is read from the SDK because it is tied to the physical geometry of the device. You stand a very high chance of making people sick if you mess with it too much.

Hi Nick
thank you for your answer

I’ve tried these commands and they seem to not make any change

this is what i’m doing:

  • run the game, then type STEREO SHOW to show the stereo info,

  • it shows: stereo ipd=0.0557 hfov=94.160 vfov=106.093

  • then I enter: OCULUSDEV ON
    STEREO HFOV=114.160 vfov=126.093 (both increased by 20)

the image doesn’t change

though, if I enter STEREO SHOW again, it does show the new values

I have tried this with OVRService on and off
in UE 4.4.3 and UE4.5.1

is there something I’m missing?

thanks in advance for your help!
Samat

Whoops, looks like there was a bug in there as well preventing it from taking. If you change the following lines in your OculusRiftHMD.cpp, and recompile, you should be able to change the FOV at will:

// debug configuration
		if (Flags.bDevSettingsEnabled)
		{
			float fov;
			bool bChangedStereo = false;
			if (FParse::Value(Cmd, TEXT("HFOV="), fov))
			{
				HFOVInRadians = FMath::DegreesToRadians(fov);
				const float HalfTan = FMath::Tan(HFOVInRadians / 2.f);
				EyeFov[0].LeftTan = EyeFov[0].RightTan = EyeFov[1].LeftTan = EyeFov[1].RightTan = HalfTan;
				Flags.bOverrideStereo = true;

				bChangedStereo = true;
			}
			if (FParse::Value(Cmd, TEXT("VFOV="), fov))
			{
				VFOVInRadians = FMath::DegreesToRadians(fov);
				const float HalfTan = FMath::Tan(VFOVInRadians / 2.f);
				EyeFov[0].UpTan = EyeFov[0].DownTan = EyeFov[1].UpTan = EyeFov[1].DownTan = HalfTan;
				Flags.bOverrideStereo = true;

				bChangedStereo = true;
			}

			// Recalculate the stereo projection matrices, if needed
			if (bChangedStereo)
			{
				const bool bRightHanded = false;
				EyeProjectionMatrices[0] = ovrMatrix4f_Projection(EyeFov[0], 0.01f, 10000.0f, bRightHanded);
				EyeProjectionMatrices[1] = ovrMatrix4f_Projection(EyeFov[1], 0.01f, 10000.0f, bRightHanded);
			}
		}

Is this fix going to be included in the released engine at some point? Looking at 4.7 8 it does not seem to be fixed yet.

Thanks!

Eventually, yes it will be fixed in main. We’re in the middle of a larger refactor to make all those settings much more consistent between devices, and it will be wrapped up in there.

After enabling the OCULUS DEV ON, I get a white screen every time I want to preview VR. So I would not recommend using this. Using 4.7.6. Relaunching the project doesn’t help. Is there any other way to change the field of view? Many thanks

Hey Nick,
Has this been incorporated into main now? I am trying to change the FOV but to no avail.

Hey Nick,

Have these console commands changed at all since this posting? They don’t seem to be recognized anymore but I am trying to do some runtime FOV changes as well.

Many thanks!