Skip to main content
Up and Coming
July 31, 2013

GUI with EZGUI

Hi there,
I saw a reply for NGUI but I use EZGUI. Basically what it does is generate 3d meshes with the objects and render them on display as if it was 2d.

Anyone knows how to implement EZGUI interfaces with the oculus? there must be an easier way than doing a whole rendertexture thing on it.
    This topic has been closed for replies.

    11 replies

    sh0v0r
    Up and Coming
    July 31, 2013
    "creat326" wrote:
    Hi there,
    I saw a reply for NGUI but I use EZGUI. Basically what it does is generate 3d meshes with the objects and render them on display as if it was 2d.

    Anyone knows how to implement EZGUI interfaces with the oculus? there must be an easier way than doing a whole rendertexture thing on it.


    The Render Target solution is easy, how much easier can it get?

    Change the camera to target a render texture
    Add texture to new material
    Put material on a Quad in front of the Camera Controller
    Up and Coming
    August 1, 2013
    O_o!!! what is this EZGUI?!?!?!?
    creat326Author
    Up and Coming
    August 1, 2013
    shovor, well i have several problems when I do that. First, what's the side of the rendertexture? how far from the camera should it be placed so that there is no empty spaces?
    does the oculus camera has to be perspective for this to work or ortho?
    Dogfight Elite now available for Oculus https://www.oculus.com/experiences/quest/3881629141886138/
    sh0v0r
    Up and Coming
    August 1, 2013
    "creat326" wrote:
    shovor, well i have several problems when I do that. First, what's the side of the rendertexture? how far from the camera should it be placed so that there is no empty spaces?
    does the oculus camera has to be perspective for this to work or ortho?


    I'm not sure specifically about EZGUI but with NGUI you set the Camera to Ortho, give it a RenderTexture (Requires Unity Pro) and now you have a texture. Note you cannot use the mouse with it and need to use a game pad or keyboard for navigation.

    You create an unlit transparent material using the render texture, put the material on a plane and place it in front of the OVRCameraController. It has to be in 3D space, traditional screen space UI doesn't work.

    You will need to tweak it and iterate to make it look good, work out what scale and distance works and what size your fonts need to be. If you attach anything to the Camera Controllers make sure it is the Right Eye, and make sure it is small enough to be viewed clearly within the focused area, this limits the amount of information you can use.

    I use a combination, for large menus I use a static plane that is attached to the player, not the camera, this way it can be larger and you can fill it with more information because the player can look around the space. For Achievement popups I made them small enough to be easily read within the 'focused' area and they're attached to the head tracking so no matter where the player is looking they will see them.


    If you haven't seen my stuff yet you might get some ideas from it...
    creat326Author
    Up and Coming
    August 1, 2013
    Yep but it doesn't seem to work well for all. For instance, a simple standard GUITexture from unity gets rendered really really small for some reason into a rendertexture. Also things get clipped for no apparent reason.
    Dogfight Elite now available for Oculus https://www.oculus.com/experiences/quest/3881629141886138/
    sh0v0r
    Up and Coming
    August 1, 2013
    "creat326" wrote:
    Yep but it doesn't seem to work well for all. For instance, a simple standard GUITexture from unity gets rendered really really small for some reason into a rendertexture. Also things get clipped for no apparent reason.


    You shouldn't be using any Unity GUI stuff ideally. The only thing I am using is TextMeshes for some Cockpit readouts. Everything else is rendered through NGUI.

    My best recommendation is to ditch EZGUI and get NGUI, the way it handles Sprites, Fonts & Layers is awesome.
    creat326Author
    Up and Coming
    August 1, 2013
    That is not an option. I'm not going to trash and redo the whole UI just because when it works perfectly fine outside of oculus.
    Dogfight Elite now available for Oculus https://www.oculus.com/experiences/quest/3881629141886138/
    sh0v0r
    Up and Coming
    August 1, 2013
    "creat326" wrote:
    That is not an option. I'm not going to trash and redo the whole UI just because when it works perfectly fine outside of oculus.


    Ok, I can appreciate that but be aware that you may need to redo a lot of your UI anyway, at least I have almost completely redone mine (an existing shipped title) because its not easy to just take an exisiting UI that was designed for mouse input and lives in screen space with heaps of resolution and just drop it in front of the Rift cameras.
    creat326Author
    Up and Coming
    August 2, 2013
    Actually it wasn't that hard. My game was not designed only for mouse, it actually runs on consoles too. So it has game pad, mouse, touch screen and more support.
    The ONLY problem was with rendering on oculus not with input, so redesigning it and rewriting it makes no sense.
    Once I figured out how to rendertexture the unity UI, it took me less than 10 lines of code to place it all into Oculus.
    Dogfight Elite now available for Oculus https://www.oculus.com/experiences/quest/3881629141886138/
    sh0v0r
    Up and Coming
    August 2, 2013
    "creat326" wrote:
    Actually it wasn't that hard. My game was not designed only for mouse, it actually runs on consoles too. So it has game pad, mouse, touch screen and more support.
    The ONLY problem was with rendering on oculus not with input, so redesigning it and rewriting it makes no sense.
    Once I figured out how to rendertexture the unity UI, it took me less than 10 lines of code to place it all into Oculus.


    Great! is it all legible though, I had to spend a lot of time thinking about how much information I could display cleanly and clearly in such a small 'focused' space. So I ended up redesigning much of it to work within the Rifts constraints.