-1

I have a VR project for which I am trying to render a canvas to be "always on top" of everything using a separate UI camera as noted here.

I made my UICamera object a child of the main camera - which is the centerEyeAnchor object in the OVRCameraRig.

camera object hierarchy

And I set the culling mask for my UICamera to only show its layer and removed that layer from the main camera (CenterEyeAnchor).

CenterEyeAnchor Inspector UICamera Inspector

But in fact the perspective is weird and it seems like the UICamera is offset a little bit but its transform is zero'd out in the inspector, so I don't why it's displaying so weird.

If I set the culling mask to "Everything" for both cameras it's still offset a little.

Yes Barry
  • 9,514
  • 5
  • 50
  • 69
  • You'll probably need two cameras, one for each eye? Also if it only renders the UI layer why is the culling mask still showing `Mixed..`? – derHugo Dec 27 '19 at 17:57
  • @derHugo It's only mixed because I have a couple of custom layers that I added as well but those don't matter. – Yes Barry Jan 02 '20 at 19:15

1 Answers1

1

In general you don't need the UI camera to be a child of CenterEyeAnchor. Move it out to to the top level and zero out the coordinates. The Oculus rig might be doing some magic with IPD or something else and it screws up the pixel-perfectness of UI.

  • By the way, this technique of using multiple cameras is no longer available if you switch to scriptable render pipeline.. – Aleksandr Stepanov Jan 01 '20 at 01:03
  • Thank you for the answer, this did the trick! Figures it was so simple. I only made it a child of the `CenterEyeAnchor` because someone else suggested that :S In the comments for this https://stackoverflow.com/a/37717861/486233 – Yes Barry Jan 02 '20 at 19:20