# How to change FOV for Oculus DK2?

**URL:** <https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459>\
**Category:** XR Development\
**Tags:** fov, unreal-engine, question\
**Created:** [October 17, 2014, 3:02pm UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459 "2014-10-17T15:02:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TTFL1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTFL1](https://forums.unrealengine.com/u/TTFL1)\
**Post date:** [October 17, 2014, 3:02pm UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/1 "2014-10-17T15:02:07Z")

</div>

Hi

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

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

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

---

<div class="post-metadata">

**Author:** ![Nick\_Whiting](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nick\_Whiting](https://forums.unrealengine.com/u/Nick_Whiting)\
**Post date:** [November 11, 2014, 12:05am UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/2 "2014-11-11T00:05:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TTFL1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTFL1](https://forums.unrealengine.com/u/TTFL1)\
**Post date:** [November 13, 2014, 11:10am UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/3 "2014-11-13T11:10:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nick\_Whiting](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nick\_Whiting](https://forums.unrealengine.com/u/Nick_Whiting)\
**Post date:** [November 14, 2014, 2:14am UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/4 "2014-11-14T02:14:56Z")

</div>

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);
			}
		}
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_79a1686a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_79a1686a](https://forums.unrealengine.com/u/anonymous_user_79a1686a)\
**Post date:** [February 24, 2015, 2:28pm UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/5 "2015-02-24T14:28:16Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Nick\_Whiting](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nick\_Whiting](https://forums.unrealengine.com/u/Nick_Whiting)\
**Post date:** [February 26, 2015, 1:20am UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/6 "2015-02-26T01:20:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alpinswimmer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alpinswimmer](https://forums.unrealengine.com/u/alpinswimmer)\
**Post date:** [May 14, 2015, 4:17am UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/7 "2015-05-14T04:17:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kabirpunde](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kabirpunde](https://forums.unrealengine.com/u/kabirpunde)\
**Post date:** [November 26, 2015, 10:11am UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/8 "2015-11-26T10:11:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ianoreo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ianoreo](https://forums.unrealengine.com/u/ianoreo)\
**Post date:** [October 19, 2016, 7:03pm UTC](https://forums.unrealengine.com/t/how-to-change-fov-for-oculus-dk2/296459/9 "2016-10-19T19:03:59Z")

</div>

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!
