[4.11.1] Manipulating FOV/Zooming in VR

Hi guys,

I am currently working on a VR project that requires us to have a “sniper zoom”-like feature.

I tried playing around with the FOV of the camera, but it seems like it’s being overriden by the headset itself. (but it works well when not in VR preview tho… xD)

I’d like to know if anybody had a solution to this problem?

As of now, the only idea I got is to have a post-process scaling up the view. But that seem as very likely to get us some bad quality as well as issues with stereo-rendering.

If you know if that’s possible. Or are 100% sure that’s not even possible, please let me know.

Best,
Erio

I just sort of gave up on this method. Ending up having a display with a render target doing the zoom in. Works ok.

Any updates?
I have the very same problem here.

Guidelines really state the importance of not overriding the field of view to a VR HMD, as this can result in simulation sickness. See: Virtual Reality Best Practices | Unreal Engine (VR and Simulation Sickness)

Perhaps this might help you come up with a different solution. The Nest (Sniper VR)

I understand this. But if we take a proper look at how things work in real life…
If you take the example of using a sniper scope, it will effectively use lenses to narrow your field of view.
I don’t think that altering the field of view is an issue in itself if it is used properly.

I’ve red those reference and although I can understand the concerns since all developers that want to do VR does not understand how to do proper VR without making people sick.

I’m still a bit disappointed by this lack of control that would be required.

We found a “solution” for now, although expensive and giving an effect different to what we did want using render targets and “display screens”.

I will take a look at what you sent regarding The Nest as it could prove interesting and might used a different technique that could help me in the future if I have to do this kind of things again.

Thanks.

After watching the video, it seems like they are using something similar as what we ended up doing. So I guess that for now it’s the only solution.
It works well for their purpose but is way less in line with our. :stuck_out_tongue:

So, so far the only way we found to do this has been to use a Render Target on a material (UMG widget/Texture on a plan) and have this render capture do the zoom in.

Not really what we hoped for but for any kind of Zoom things, seems like it’s the only way to go around it currently in VR.

I’m leaving this quite simple, if you understand what’s meant here, then great, otherwise add a comment and I will try to help a bit more. :slight_smile:

Thanks a lot.
Plan to use render target too.
Will post a update after I implemented this.

Long time passed, but… How do you inject the render target texture into VR view?

Basically, you create a material and use that render target as a texture in it. Then you place that material on a plane or any mesh that fits your purpose and place it in the world (attached to the headset or any object where you want it to be displayed). From memory at least that’s the gist of how it should work.

Good luck!

Thanks, already got it working using stereo layer.

I would like to bring this issue back. I have been looking for a solution for this as well. If used properly this does not have any negative effects to the user. Please, lets focus on finding a solution to where this can be implemented and tested, rather than arguing about if it should be done.

Primary Question:
Where/how can we implement zoom in VR using the main camera (no render targets)?

I have found by modifying the SteamVRHMD class I can scale the planes rendered in the stereo projection matrix.

The problem with this, is that is messes with the distortion needed to render VR properly as it is scaling the image AFTER the distortion is applied and the scene starts to look a little flat.

I am trying to find a way to zoom/scale or change the FOV earlier in the pipeline. Please, anyone with ideas or knowledge of how to accomplish this, share how this can be done. Thank you!

What I’ve done:
UE 4.24

Engine/Plugins/Runtime/Steam/SteamVR/Source/SteamVR/Private/SteamVRHMD.h:194
ADD:

float MatrixPlaneMultiplier = 2.0f;

Engine/Plugins/Runtime/Steam/SteamVR/Source/SteamVR/Private/SteamVRHMD.cpp:1468
UPDATE TO:

FMatrix Mat = FMatrix(
		FPlane((MatrixPlaneMultiplier * InvRL), 0.0f, 0.0f, 0.0f),
		FPlane(0.0f, (MatrixPlaneMultiplier * InvTB), 0.0f, 0.0f),
		FPlane((SumRL * InvRL), (SumTB * InvTB), 0.0f, 1.0f),
		FPlane(0.0f, 0.0f, ZNear, 0.0f)
		);

Engine/Plugins/Runtime/Steam/SteamVR/Source/SteamVR/Classes/SteamVRFunctionLibrary.h:70
ADD:

UFUNCTION(BlueprintCallable, Category = "Steam VR Camera")
	static void SetMatrixPlaneMultiplier(float Multiplier);

Engine/Plugins/Runtime/Steam/SteamVR/Source/SteamVR/Private/SteamVRFunctionLibrary.cpp:39
ADD:

void USteamVRFunctionLibrary::SetMatrixPlaneMultiplier(float Multiplier)
{
	FSteamVRHMD* SteamVRHMD = GetSteamVRHMD();
	if (SteamVRHMD)
	{
		SteamVRHMD->MatrixPlaneMultiplier = Multiplier;
	}
}

Then in BP you can LERP between something like 2 and 8 to get a smooth zoom effect in VR. As mentioned, the issue is the scene starts to look a little flat.

Any idea for Oculus Quest?

Also looking for an Oculus Quest solution for this.