I’m working on a VR video player and need to add the ability for the user to zoom in and out, as it’s a common feature in VR video players. Is there any workaround for changing the FOV in VR?
I tried moving the video dome closer and further away from the camera, but that made it nauseating when I would look around.
fov (and the projection matrix) is being provided by the headset itself. We can’t manipulate it. trying to change this will cause more issues than moving objects closer and further away
You can scale elements, which would be the way I would recommend to go here. of course, to a certain extend.
I assume you want to have a “fullscreen” effect in XR?
Thanks for the response!
For the video player, it’s using a video dome. So unfortunately, scaling it won’t have an effect.
I also tried creating post processing that would adjust the screen UV to make it zoom in. While it did zoom, it looked off in the headset, as it also affected the lens distortion. So would there be any way to create post processing that’s applied before the lens distortion is applied?
Want to show me h you mean exactly? lens distortion should b solved by the headset/os/brower. we get the needed data to project the scene to the headset and nothing more
Sure! I have created some illustrations to demonstrate it.
Zoom through post processing:
Here’s the post processing I created for it: Babylon.js Node Material Editor (babylonjs.com)
Since the post processing is applied after the distortion, it results in less distortion the further you zoom in. This makes the image look flat and gives a weird tilting effect when turning your head. On top of that, it also makes things appear at a lower resolution since it just stretches the image.
Zoom through camera position:
The idea is that that the video dome would be moved closer to the camera in order to simulate a smaller field of view. So if the viewer would look right, the video dome would be moved left to maintain the same distance from the camera to the edge of the dome that is in front of it.
While this seemed like a good idea in theory, in practice, it just makes it feel like the camera is swinging around as you look around, which is quite nauseating.
Zoom through camera FOV:
This would be the ideal way to be able to handle zoom. But I understand if it’s tricky.