Forum Discussion

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

DK2 | Canvas rendering space | VR supported

I understand by default, canvas renders to screen space, but we also have the option to render it in world space, which is exactly what we need for Oculus Rift. Is this correct?

One of the attachments shows the details in my Inspector, but I get a black screen when I run the app in VR. Should I remove the Main Camera and add a different camera? Are there any subtleties or tricks here, or am I missing something or doing something wrong?

I also get the following 2 messages in my Unity console:

[CAPI] LibOVR module is located at C:\Windows\system32\LibOVRRT64_0_6.dll
[TrackingStateReader] Prediction interval too high: 0.100000 s, clamping at 0.100000 s


My Player Settings are also attached. I am running Unity 5.1.1f1 and Oculus 1.7 (SDK 0.6.0.1). I would very much appreciate help and guidance...

canvas.PNG

player_settings.PNG

8 Replies

Replies have been turned off for this discussion
  • I'd recommend using Unity 5.1.2p3 but I'm not sure that's your issue.

    I'm also not sure the Canvas has anything to do with your issue. Does the camera render without the Canvas?
  • OK, thanks, I will apply the patch...

    The camera does render without the canvas, and also renders my menu scene, but in the rift I do not see/find the mouse cursor, so I have no idea how to tick a check-box or press a button.

    I have created a menu for my app, with 4 toggles and a button. When I check the Virtual Reality Supported option in Unity 5.1.1f1 with the Oculus being in Direct Mode and Canvas Mode in World Space, I can see it in the 3D space, but I cannot see/find my mouse to tick one of the toggles. When I take off the headset, on my monitor's Game View tab, I can see and even use the mouse and select a toggle (Obviously, I have to keep the headset steady, so in my Game View, things do not shake!).

    I would appreciate any help,
  • I'm just running into this issue myself so I'm not sure how much help I will be to you but....

    My thinking is that the "virtual reality supported" checkbox doesn't currently turn the mouse cursor into a world space or even stereoscopic cursor. So although the canvas elements have a handy worldspace mode (which is applicable beyond VR contextxs) the mouse cursor itself does not. If I am correct on this then there is no out of the box solution for what you're trying to do and you will need to do some research on how other people have achieved this.

    Just as I am about to do unfortunately!
  • I see... Thanks for your reply, jonathandovis.

    So, I was kinda right when I thought I could not really use mouse clicks or button presses on a canvas menu in VR. The funny thing is that when I hold the headset steady in a way that the menu is close to the camera, I can take a sneaky look at my computer screen and do the clicking/pressing on the Game View tab, but not always of course!

    A silly workaround would be running the menu scene without VR and then turning on the VR when moving on to the next 3D scene, but I guess we cannot check and uncheck that box while the app is running?

    p.s. Would you be so helpful to post back if you came across something genius that you thought would be a great alternative to this?
  • @ jonathandovis: I think for now, I will resolve this situation by taking the following steps:

    ( I tested... It works... )

    1. Tick the Unity VR support check box.

    2. Set the Canvas render mode to Screen Space - Overlay.

    3. Build a standalone in some folder, say, C:\Desktop\myBUILD

    4. Run the standalone via command line:

    C:\Desktop\myBUILD> projectNAME.exe -vrmode oculus

    This, in my case, results in my menu scene NOT being visible in VR (in Oculus Rift) BUT visible on my computer screen, so I can check a toggle and press a button, etc... and then the main scene that is loaded next will appear in VR (in Oculus Rift).

    I just do not understand why running the standalone by doing ctrl+B does not work...