Forum Discussion
dshankar
10 years agoHonored Guest
How does OVROverlay work? Can I use it with custom meshes?
Here's my understanding of how OVROverlay works:
Use it on a world-space quad. If a frame drops, you can render this overlay blended on top of the previous eye buffer, positionally adjusted relative to the headset location. This will make this overlay appear to be moving appropriately corresponding to head movements, despite a dropped frame.
How does this increase apparent resolution and text readability? (See Carmack's tweet)
At some point, can I use my own custom mesh filter instead of just a quad?
Use it on a world-space quad. If a frame drops, you can render this overlay blended on top of the previous eye buffer, positionally adjusted relative to the headset location. This will make this overlay appear to be moving appropriately corresponding to head movements, despite a dropped frame.
How does this increase apparent resolution and text readability? (See Carmack's tweet)
At some point, can I use my own custom mesh filter instead of just a quad?
3 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffMost VR content is rendered to a texture using a standard perspective projection and then barrel-distorted to the backbuffer. That is reasonably efficient, but it causes some loss of detail as the distortion causes an extra stage of texture interpolation. In contrast, the main advantage to direct-sampling is that it preserves more of the sharp detail from the original texture.
There are currently 2 main types of overlays: world-locked and head-locked. Both of them use a special per-pixel distortion shader that samples directly from a texture on a transformed quad. As a result, it's hard to use arbitrary meshes or custom overlay shaders. World-locked overlays use TimeWarp, similar to non-overlay content. Head-locked overlays bypass TimeWarp and exactly follow your head motion.
Both kinds of overlays are now exposed through the Oculus utilities for Unity via the OVROverlay script. All you have to do is make a Quad GameObject, add a texture, and add the OVROverlay.cs script. If the Quad is a child of the OVRCameraRig's center eye anchor, then it will be head-locked. Otherwise, it will be world-locked.
On Gear VR, the direct-sampling shader can support a text sharpening technique based on signed distance fields (http://www.valvesoftware.com/publicatio ... cation.pdf), but it isn't exposed through Unity yet. Text will still be noticeably sharper without this shader. On PC, we don't have signed distance fields, but we do use a form of anisotropic filtering to improve sharpness. - wheatgrinderExplorerwhere can I learn more about this?
I have a spot in my game where I KNOW that Im going to drop a frame or two (loading many objects in) right now the game seems to lock for a frame or two and it is very ugly feeling. Can I use the Overlay to present some image in the world space over the scene that remains tracked correctly though the underlying game has drooped a frame? This would cover my problem sport nicely. - vrdavebOculus StaffFor Rift overlays, see https://developer.oculus.com/documentat ... der_layers and https://developer.oculus.com/doc/0.8.0. ... _quad.html. For mobile, see http://static.oculus.com/documentation/ ... ilesdk.pdf. You can also download the Mobile SDK and look at the source code for the mobile Unity plugin. We actually implement Unity's built-in Gear VR support very similarly to the way it's done in that file.
"wheatgrinder" wrote:
I have a spot in my game where I KNOW that Im going to drop a frame or two
If this is a Rift app, I would recommend fading to black before this spot. The only way to prevent the image from freezing is to keep frame rate by breaking your game's work up into 5-10ms chunks. In the future, Rift apps will be able to use asynchronous TimeWarp to fill in one or two frame drops as performance fluctuates. ATW is available today on Mobile. But it isn't a silver bullet and the best advice is to optimize the app.
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
- 6 months ago
- 11 months ago
- 7 months ago