Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
drash's avatar
drash
Heroic Explorer
12 years ago

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!

33 Replies

Replies have been turned off for this discussion