0 votes
  • When I'm trying to add some alignment lines for mobile VR (Google cardboard sytle), and potential later implementation of some adjustment UI tool before I put the phone in the headset, I came a cross that the UI is either distorted altogether or VR could not be enabled.

  • Pictures shows as follows:

    • When I use separate viewport for ARVR and UI, the ARVR could not be enabled(Through click in UI or script)
      When I use separate viewport for ARVR and UI, the ARVR could not be enabled(Through click in UI or script)
    • When I enable ARVR on root node(via script), the UI layer is also distorted
      When I enable ARVR on root node(via script), the UI layer is also distorted
  • What did I do wrong

  • Also a minor question

    • In the ARVR document there's an oversample that's defaulted to 1.5
    • When I debugprint the arvrinterface.get_oversample(), it also says 1.5
    • But seems there's still the black area on the edge, or did I understand the oversample's function wrong and it isn't supposed to sample beyond the camera.

Thanks in advance

asked Apr 12, 2019 in Engine by victorzzt (12 points)

1 Answer

0 votes

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.

answered Jul 11, 2019 by Mux213 (40 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.