Skip to main content
Up and Coming
August 18, 2015

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
    This topic has been closed for replies.

    8 replies

    Inspiring
    August 18, 2015
    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?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    hmiriAuthor
    Up and Coming
    August 19, 2015
    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,
    New Participant
    August 19, 2015
    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!
    hmiriAuthor
    Up and Coming
    August 19, 2015
    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?
    hmiriAuthor
    Up and Coming
    August 19, 2015
    @ 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...
    Inspiring
    August 19, 2015
    Correct, the mouse cursor does not work in VR. You can add it yourself, but it's a little more complex than you'd expect. You guys should check this post on gaze based input. It may be a good starting place for what you want:

    http://talesfromtherift.com/vr-gaze-input/
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    hmiriAuthor
    Up and Coming
    August 20, 2015
    Fantastic. This is exactly what we need. Thanks cybereality!

    I also came across the following post on Unity forums that I share here, just in case anybody finds it interesting or helpful:

    http://ralphbarbagallo.com/2014/08/20/oculus-rift-world-space-cursors-for-world-space-canvases-in-unity-4-6/
    Inspiring
    August 20, 2015
    Great.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV