Best Practices for XR 2D UI

Hi everyone,

i am curious what the best practices for an XR UI are, using the OpenXRCompositionLayer.

Imagine a scene with a 2D UI in front of the user, separated in three segments:
left-menu | center with image etc. | right-menu

  • Should i use three different OpenXRCompositionLayer instances for the three segments or better use a single one with an HBoxContainer?
  • As far as i understand it, the resolution configured under Project Settings → Window → Wieport Width/Height is used for every composition layer. So what is a reasonable resolution for e.g. the Meta Quest 3?

Thanks for any help and best regards!

If all three panels are side by side in a single plane, its probably more efficient to do a single composition layer and just lay them out properly.

If you want the side panels slanted (like Quest does in their own UI when opening multiple panels), having 3 composition layers works fine. There is a little overhead in rendering 3 viewports but seeing its 2D content it shouldn’t make too much different. The total size of the 3 viewports has far more effect and that would likely be the same in either solution.

I’m not sure why you think Project Settings -> Window -> Viewport Widht/Height is important here. That is simply the default size of windows opened (including the main window) which doesn’t really apply here.

For composition layers you can define the resolution of the viewport, on the viewport linked to the composition layer itself.
What resolution is best is dependent on the size of the panel and the distance the panel is placed from the user, so just experiment with what looks good and make a judgement call.

Thanks for your reply. It’s good to know there is no drawback going one way or the other regarding composition layers.

About the resolution: what got me confused were the “blue helper lines” (i don’t know how they are called correctly) in the UI editor, which mark the configured window resolution (i guess). I thought those were used in the composition layers, too. Thanks for the clarification. :+1: