Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Rendering scene with GUI to the monitor and without one to the Oculus

Discussion in 'AR/VR (XR) Discussion' started by Protasov, Aug 10, 2015.

  1. Protasov

    Protasov

    Joined:
    Aug 10, 2015
    Posts:
    6
    Hi, guys! Sorry for possible mistakes in English...

    I need to render a bit different views of scene to the oculus and to the monitor, and the last one should have a GUI. I use OVRMirror to render to additional window, but in such way GUI elements are only a part of the texture and has no interactivity (e.g. buttons doesn't respond on clicks or hovering). There is an idea to send mouse events from additional window to the canvas, which owns those elements, but I don't know how to do it and is it even possible. Can someone help me? Maybe there is another way to make mirroring of Oculus view with additional GUI?
     
  2. Orion_78

    Orion_78

    Joined:
    Feb 13, 2014
    Posts:
    66
    To render different things regarding the camera, you can simply use Layer

    You can use Raycast or the EventSystem Unity to click on the On Screen GUI

    Hope it helps
     
  3. Protasov

    Protasov

    Joined:
    Aug 10, 2015
    Posts:
    6
    Thanks for your reply!

    I thought that Raycast just can help to find the object. But I don't want to change GUI states by myself, I want that Unity did it. And there is another difficulty, which is that the GUI layer is rendered not on the screen but to the texture, and then sent to another not-Unity window. So I need the way to tell the engine where is my mouse position in terms of canvas and what the state it has. Initially I wanted to use EventSystem, but didn't find how to do that. Working directly with GUI elements states seems to be very difficult and inflexible, so I really want to avoid that. Maybe I've understood the Raycast and EventSystem functionality incorrectly...could you please tell me how should I use them to achieve needed result?