Debug UI for Mobile Native VR, and the overscan

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By victorzzt

Thanks in advance

:bust_in_silhouette: Reply From: Mux213

I really should keep an eye out on the Q&A site. This is probably way to late but just in case.

You can’t use a separate viewport for the mobile VR interface because the output needs to go to screen, there isn’t an external HMD. So the second example is the correct way for mobile VR. You switch the main viewport to ARVR mode after initializing the interface.

For a cardboard (or any VR HMD device) the screen has to be distorted because the lenses create a barrel effect when looking at a screen. The problem is that different lenses require different levels of distortion which is controlled by the K1 and K2 parameters of the interface. The defaults here if I recall correctly are for the lenses in a GearVR headset. Google cardboard has much weaker lenses.

The problem with lens distortion is that it compresses the image the further out you go leaving part of the screen unused. You can increase the rendered area by oversampling, basically you are increasing the FOV but the tradeoff is that you render at far higher resolutions.

A lens such as those on GearVR or other more capable headsets is that you can never use the full screen, so there will always be a part of the screen that remains black.