Binoculars/Telescopes in VR

In some VR games, you want to let the player look through binoculars or a gunsight or a telescope. It is apparently impossible to correctly change the field of view of the main camera in VR. Therefore, we’ve been implementing these features with render textures, where we render the “zoomed in” field of view to the render texture, then show this render texture on the “lens” of the optical sight.

While this “works”, it is very expensive to render the entire scene yet again. We would rather just change the main camera’s field of view to not add any new render passes.

Is this possible somehow in VR with Unity?

Hi, did you ever come up with a solution to this? Thanks!

No, we’ve been using render texture for this as described.

I guess you could write a shader that expands everything, scaling verts. Maybe in clip space or something.

This kind of thing is so hard when targeting cross-platform VR, though!

The online multiplayer Onward game uses the render to texture strategy and seems to run fine. I think if you keep your texture resolution somewhat low, it should be ok.

1 Like

Thanks for the reply. Yeah, this is what I ended up doing. That along with a post processing volume made it pretty nice.

I got 2048 and have no issues (PCVR) what-so-ever. It is only active when close to the head.

Also, I found this video and shows how to do a shader (I think this is what hipocoder was referring to), but the problem with this is it gets pixelated when you zoom in a lot.

https://www.youtube.com/watch?v=IC5JoS0wX0s

1 Like

I believe Resident Evil 4 VR does this for it’s rifle zoom by doing something extremely similar to the Zoom shader effect in the video above, except they black out the screen and/or put it in world space at the end of a black tube to reduce overdraw.