Different images in Unity



  • Avatar

    Hi Flavio,

    I haven't tried it directly with canvas elements specially, but the way I typically handle this is that I setup the left/right camera to render different layers. Then I place the elements I want to render per-eye on specific layers that are only rendered by each camera.

    If this doesn't work for Canvases, I can try to poke around with Unity and see if there's a different way.

  • Avatar

    Hi Jeff, thank you so much for your answer!

    Ok, so I tried a simpler example which doesn't use canvases. I've arranged a cube and a sphere, and I would like to show the cube on the left eye, and the sphere on the right eye. I've defined two layers (LeftEye and RightEye) and two cameras (LeftEyeCamera and RightEyeCamera). The Target Eyes and Culling Masks of the cameras are configured to define the intended outcome. The Layers of the cube and the sphere are defined correspondingly.

    I've copied my set up in the attached image.

    Unfortunately, I can't get the desired outcome. I see the cube and the sphere on both eyes. What am I missing? Thank you so much!

  • Avatar

    That looks like more or less the same setup that I had success with - with the one exception is that I used FoveInterface (original as opposed to 2) last time I checked it, and I had to modify the camera layers at runtime because FoveInterface creates it's cameras at runtime.

    I'll try to get time to try it with FoveInterface2 soon, finishing some other tasks at the moment.

    If you're totally blocked on it you could try FoveInterface temporarily (FoveInterface2 is recommended in that it leverages more of Unity's VR pipeline, but if it's not working you can hop back temporarily - and they both implement the same base class for handling Gaze, etc).

  • Avatar

    Hi Jeff, thank you once more. Actually, following your suggestions, I got it working with FoveInterface and 3D objects in world space. But, it looks like I can't get it working with canvases. :( Here's what I observed.

    • I can't use FoveInterface2 since it doesn't create Fove Eye (Left) and Fove Eye (Right) cameras.
    • Anyway, using FoveInterface2, I can see GUI objects in the canvas (but, only on both eyes): I set Render Mode: Screen Space - Camera and Render Camera: Fove Interface 2. Unfortunately, if I set Render Camera: Fove Interface then I can't see GUI objects (it looks like Screen Space canvases only work with FoveInterface2).
    • If I use FoveInterface, then I can see GUI objects only if I use Render Mode: World Space (but I need Screen Space for my project). Anyway, while setting layers and culling masks actually works with 3D meshes (it works with a cube and a sphere), it looks like it doesn't work with canvas' elements (I see them with both eyes, even if I set the same layers as for the 3D meshes).

    Since I don't want to derail this topic, this is the desired outcome: I would need to see a GUI object with the left eye and a different GUI object with the right eye, in screen space, so I'm looking for an approach to get this. Thank you very much! ^_^

Please sign in to leave a comment.