[SOLVED] Multi viewport issue - UI drawn under objects

I’m trying to set up a scene where the screen is split into a left and a right view. (not stereo, just different camera views of the scene) So both cameras set to W=0.5 and X=0 for the left view and X=0.5 for the right view. This works for the two views. I’ve turned off the UI and Skybox layer for each camera and unchecked clear color buffer. The skybox and UI are put in via a third camera. This seems to work fine for the skybox but the UI does not draw on top of the objects.

Here is a screenshot of the issue.

I’ve created a small project that demonstrates the issue here…

I’ve tried rearranging the cameras and the screen2d object in the hierarchy but nothing seems to affect the draw order. Is there a way I can get the UI to reliably appear on top of both viewports?

The camera stacks in priority order. The UI camera priority is set at 0 so it renders before or after Camera Alt. Then Camera Main is rendered last.

It looks like in this case the order was:

  • Camera Alt
  • CameraUIandSkybox
  • Camera Main

Fixed the camera priority order and clear flags here: https://playcanvas.com/project/796234/overview/ui-issue-from-forums

1 Like

omg. I totally missed that. Thank you so much.