Forum Discussion
drash
12 years agoHeroic Explorer
Zooming with the new SDK
I can imagine that the ability to zoom in a VR game is a sensitive topic, and likely to invite a "don't do that" / "violation of best practices", etc. As far as I can tell, users enjoy the zoom feature in Titans of Space, and Yosemite Spyglass made great use of it. Then you have something like Private Eye where the whole premise is looking through binoculars. I believe Desperate Gods also has an implementation of zoom as well, but I imagine positional tracking would render it obsolete in that particular case.
In the past, I accomplished this by smoothly adjusting the OVRCameraController's vertical FOV via SetVerticalFOV(), and this worked reasonably well as long as you're not zooming onto something that's very close to you.
In the newer SDK however, SetVerticalFOV() appears to have new behavior, where it simply changes the size of the "hole" through which the player can view the scene. Understandable, because the true rendered FOV is now internally calculated as a function of eye relief and other factors.
In addition, probably because it has to recalculate the distortion mesh every time something fundamental as the FOV is changed, this sort of smooth adjustment incurs a serious performance hit. In the video below, it goes from 125 FPS (capped at 60 in the video because of video capture software) down to 45-50 FPS when SetVerticalFOV() is being called every frame with a new value.
I suppose there are other options for zooming, such as moving the actual camera rig itself out along the line of sight but this breaks down if there's anything in the foreground that should be in the zoomed view, and in general it's really not the same since it also involves a change in perspective.
Any suggestions from other devs that have played with zooming and the new SDK, or even suggestions from the Oculus team on what the recommended approach should be going forward? Many thanks in advance!
In the past, I accomplished this by smoothly adjusting the OVRCameraController's vertical FOV via SetVerticalFOV(), and this worked reasonably well as long as you're not zooming onto something that's very close to you.
In the newer SDK however, SetVerticalFOV() appears to have new behavior, where it simply changes the size of the "hole" through which the player can view the scene. Understandable, because the true rendered FOV is now internally calculated as a function of eye relief and other factors.
In addition, probably because it has to recalculate the distortion mesh every time something fundamental as the FOV is changed, this sort of smooth adjustment incurs a serious performance hit. In the video below, it goes from 125 FPS (capped at 60 in the video because of video capture software) down to 45-50 FPS when SetVerticalFOV() is being called every frame with a new value.
I suppose there are other options for zooming, such as moving the actual camera rig itself out along the line of sight but this breaks down if there's anything in the foreground that should be in the zoomed view, and in general it's really not the same since it also involves a change in perspective.
Any suggestions from other devs that have played with zooming and the new SDK, or even suggestions from the Oculus team on what the recommended approach should be going forward? Many thanks in advance!
33 Replies
Replies have been turned off for this discussion
- sh0v0rProtegeI tried modifying the Camera FOV values and this works but I found that it produced some weird depth effects, things seem to look flattened out. I guess like you said it depends on how far away the object is, I was zooming onto a Zombie that was only 20 feet away.
- jhericoAdventurer
"drash" wrote:
I can imagine that the ability to zoom in a VR game is a sensitive topic ... Yosemite Spyglass made great use of it!
I disagree. I think zooming is something that's required functionality, but zoomed in areas should be presented as a sub view within the overall scene... either with something somewhat artificial like a HUD window that pops up and lets you see the zoomed in area, or something more naturalistic like a scope or binoculars that are visually represented, and through which the zoomed area can be viewed.
The core issue here is to not create a disruption between the head movement and the corresponding eye movements produced by the vestibulo-ocular reflex. As long as the zoomed in area is being treated by the brain as an artificial construct (i.e. a window within your overall field of view), then you're fine. But if the user has a sense of presence and you mess with it by changing the overall FOV, then that's recipe for VR sickness. - jhericoAdventurer
"sh0v0r" wrote:
I tried modifying the Camera FOV values and this works but I found that it produced some weird depth effects, things seem to look flattened out. I guess like you said it depends on how far away the object is, I was zooming onto a Zombie that was only 20 feet away.
Your brain is noticing the sudden absence of parallax. At 20 feet away, your can't perceive any difference in the image of a zombie between your left and right eyes, but your brain accepts that because you know based on the size of the human figure that you shouldn't actually get any parallax. When you zoom in, the zombie becomes bigger in your field of view, to the point where he might be only a few feet away based on the size of the human shaped figure.... but because it's a zoomed image with the same per-eye offset, you still don't see any per-eye differences, any more than you would by using a magnifying glass on a flat picture. Your brain notices the disparity between the size of the figure and the number of depth cues you're getting. - drashHeroic ExplorerDecided to do a quick experiment on doing "zoom" via extending the camera rig out in the direction of your line of sight. Turns out it's quite a rush to experience. I can't imagine it will be comfortable for those new to VR, though. And it can be twitchy since it relies on extending the camera out partway to wherever a raycast hits.
"jherico" wrote:
"sh0v0r" wrote:
I tried modifying the Camera FOV values and this works but I found that it produced some weird depth effects, things seem to look flattened out. I guess like you said it depends on how far away the object is, I was zooming onto a Zombie that was only 20 feet away.
Your brain is noticing the sudden absence of parallax. ...
Nice, that's an excellent description -- it makes total sense to me now. - cyberealityGrand ChampionThat actually looks good to me.
- owenwpExpert ProtegeI think the best solution it so simulate magnifying optics directly in your game. In some games that could be as simple as having a virtual TV monitor hooked up to a virtual camera. Tricker but more interesting would be rendering the scene again into a smaller viewport that overlaps with a virtual binocular eyepiece, using a projection defined by the actual position and orientation of the binoculars. Then using positional headtracking and/or motion input devices, let the user move their eyes into or away from the binoculars at will, just like in real life. This would be a lot more comfortable than apparently locking magnifying lenses to the user's face, covering their entire FOV.
- sh0v0rProtege
"drash" wrote:
Decided to do a quick experiment on doing "zoom" via extending the camera rig out in the direction of your line of sight. Turns out it's quite a rush to experience. I can't imagine it will be comfortable for those new to VR, though. And it can be twitchy since it relies on extending the camera out partway to wherever a raycast hits.
That looks pretty cool Drash, you might want to consider covering up the 'zoom' part of it with a quick fade blink between the extents and having a fixed distance rather than based on a raycast length to avoid the twitchiness. How does it feel when looking around, I'm guessing you're moving the whole controller so neck modelling will feel the same, you're essentially teleporting the head? - drashHeroic Explorer
"sh0v0r" wrote:
That looks pretty cool Drash, you might want to consider covering up the 'zoom' part of it with a quick fade blink between the extents and having a fixed distance rather than based on a raycast length to avoid the twitchiness. How does it feel when looking around, I'm guessing you're moving the whole controller so neck modelling will feel the same, you're essentially teleporting the head?
That's a nice idea sh0v! A quick-fade idea would be worth trying. I reduced the twitchiness quite a bit by using a new layer of generally-shaped colliders instead of raycasting onto the individual detailed colliders of the level itself. Yes I'm essentially turning the neck into a really long one. And it feels quite OK to me when looking around -- but honestly I can't trust how I feel because it just seems like something that would be sickening to others. I uploaded a demo of this technique that lets you adjust some parameters of the zoom. Would be curious to know what you think.
The demo can be downloaded here. It's "Experiment: Zoom via Camera Extension" at the top of the list. - PoddenProtegeYou actually can change the depth of field of the OVRCamera, but you have to change it seperatly in the CameraRight and CameraLeft camera.fieldofview varibales instead of the OVRController. The OVRCameraController.verticalFOV variable seems to have changed it's function in the 0.3.x SDKs to control something like a quality/distortion ratio.
- drashHeroic Explorer
"Podden" wrote:
You actually can change the depth of field of the OVRCamera, but you have to change it seperatly in the CameraRight and CameraLeft camera.fieldofview varibales instead of the OVRController.
Thank you! :) It does seem like I'm getting the same effect as before just changing the camera FOV's directly -- thought the distortion params needed to be recalculated or something.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 2 years ago
- 11 years ago