Page 1 of 1

The order of rendering with Unity UI

Posted: 08 Sep 2022, 11:11
by DevFear
I am working on the transition from the classic Unity UI to Noesis. I noticed that the elements from Unity UI are displayed on top of the elements from Noesis. Is it possible to globally change the rendering order?

Re: The order of rendering with Unity UI

Posted: 08 Sep 2022, 11:22
by jsantos
Similar to using post-processing you can use camera-stacking (several cameras rendering to the same screen) to play with the order of elements and "when" Noesis renders.

Re: The order of rendering with Unity UI

Posted: 14 Sep 2022, 20:40
by DevFear
And what if the project is made on HDRP?

Re: The order of rendering with Unity UI

Posted: 15 Sep 2022, 10:31
by jsantos
The link I posted above gives you instructions for Legacy, Universal and High Definition pipelines.

Re: The order of rendering with Unity UI

Posted: 15 Sep 2022, 11:19
by DevFear
I'm sorry, but maybe I didn't quite understand the instructions. In the example, the red square is the Canvas Unity image. The exit window is the Noesis element. As you can see, the square is still drawn on top.
Image
Image

Re: The order of rendering with Unity UI

Posted: 15 Sep 2022, 12:20
by jsantos
Yes the idea is:
  • Rendering Unity UI to a camera
  • Render Noesis View to a different camera
Use the instructions in the given link to decide the order of those two cameras. Note that both cameras are rendering to the same screen.

I haven't tried this with Unity UI, but I think it should work.

Re: The order of rendering with Unity UI

Posted: 15 Sep 2022, 13:55
by DevFear
Does not work. I tried all the combinations. CustomPass Noesis works before the Unity UI render is triggered.
Image

Re: The order of rendering with Unity UI

Posted: 16 Sep 2022, 10:49
by jsantos
I think you need to move the Unity UI to another custom pass, that way you can control if it renders before or after noesis.

Re: The order of rendering with Unity UI

Posted: 19 Sep 2022, 13:20
by DevFear
What do you mean? Is this really possible?

Re: The order of rendering with Unity UI

Posted: 20 Sep 2022, 16:35
by jsantos
I am not an expert on Unity UI, and you probably need to get help on Unity forums. But yes, I think it must be possible to achieve that.