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

    New Participant
    August 6, 2013
    Hi, This topic is very close to the question I want to ask and since I cannot for the life of me figure out how to post a new topic; I suppose I will ask here.

    I’ve been reading the forums about the vaunted topic of HUD / GUI elements and the current solutions regarding NGUI / EZGUI. However as someone that has developed my own method of rendering HUD elements to the screen I’m not sure how well these methods will apply.

    The system I am using.

    For rendering HUD elements to the screen I have employed the use of orthographic rendering for per pixel placement of my HUD. What does this mean? For this example I will use my 3D Radar from the Unity forums and will be focusing on the Target Selection Box.

    Setup:
    Rift Cameras L/R (Perspective): Depth 0.
    HUD Cameras L/R (Orthographic): Depth 1, Clear Flags = Depth Only.

    1: I create a quad and apply a texture material that contains my texture atlas and UV offset to the correct position in the texture.
    2: Get the targets position from world space and convert it to screen space via the players L/R Camera. This lets me know where on the screen space the target is.
    3: Convert the screen space back into world space via the HUD / Orthographic camera and place the Target Selection Box over the target.

    This method of course is rendering the HUD on a separate camera from the Rift and thus brings me to the issue.
    All of this works great for a standard desktop development environment, but not so much for the Rift; primarily because of the use of Lens Correction. When Lens Correction is enabled, this causes a floating effect for the Target Selection Box (TSB). It appears that the TSB shift around the target as it moves across the screen. This is because Lens Correction is being applied to the Main Rift camera and not the HUD orthographic cameras. When the Lens Correction is disabled then everything works and looks just fine.

    My question is this
    1. Is there a way to apply Lens Correction to an Orthographic camera?
    or
    2. Is there a way to apply Lens Correction after the Orthographic camera has rendered in combination with the Rift cameras.?
    or
    3.Do I need to ditch this method and try to render my HUD in front of the Rift Player perspective cameras.?

    I do not care much for the last as I lose pixel precision. But if that's the way it is then that's the way it is.

    You can find the 3D Radar with it's current Oculus support here: http://forum.unity3d.com/threads/79163-3D-Radar

    Thanks for your time