How is UI supposed to work in HDRP with one camera?

Hey
We need some guidance with how to handle the ingame HUD with just one camera as demanded by HDRP.

HDRP demands only one camera as of now, but this means post processing and everything also affects our UI
And if you want to enable TAA, the UI gets extremely blurry when moving the camera, which is making it unusable

Tonemapping makes the UI very poorly readable.

We tried following that one FPS demo tutorial but that is for LWRP with the render passes and the options do not exist in HDRP.

What is the intended workflow?

3 Likes

You can exclude layers from your volume.
Are you talking about a screen overlay UI or a 3D one?

We have a classical overlay Hud but its also using some 3D elements / Planes with materials

Are you sure? When I tried layers that did not change anything in the volume. Also post processing should technically not be able to seperate between layers no? Changing layers does nothing to the volume, both in local and global setting, just tested

With a second camera you could exclude post processing by turing them off in the custom frame settings of the HD camera.
But with only one camera I think you only could make a difference with Light layer.

So if you have a dark tonemapping, you could add a light source that affects only your 3D UI through light layers in order to make them brighter.

1 Like

There must be one official way to handle UI when support for more than 1 camera was removed, traditionally a separate camera is used and every game has UI, surely the HDRP Team has one particular way of doing this in mind

1 Like

I'm also having difficulties with using one camera

  • UI Camera
  • Dual render scope
  • First person hands / weapons clipping through objects
  • Top down radar view

It would be nice to know how to deal with these scenarios, or what plans the team has in mind for the future.

2 Likes

Push

Similar issue - I NEED to exclude assets from post processing in HDRP - IT'S ESSENTIAL!

Yes exactly

Hi. We have several 3D planes with Video Players and other streamed texture content in our scenario.
How i can exclude them from TAA.
TAA is smearing this content in all settings but it is needed for all other 3D geometries.

In BuiltIn RP we render these content with a second camera without TAA.

1 Like

Repoert this as bug. Only way it could be addressed with final 7.20.

Mhmmm? It s not realIy a bug.
You could solve it with camera stackin in BuiltIn RP.
In HDRP it did not find a way to create an comparable "workaround".

Hope someone has some idea.

HDRP is terrible with more than one camera right now. All sorts of performance issues and bugs when using more than one camera in a scene. I'm guessing you'll have to wait for it be fixed internally by Unity.

I played it a bit but I don't know how to do it.

Is it possible to create a custom pass and exclude UI from PP ?

Maybe scriptable but that surely requires an experienced graphics programmer which our team does not have
In LWRP there is a tutorial for it but comparable things do not exist in HDRP it seems

I assume there is just no solution in place yet, but this definitely should have a high priority on the radar, there needs to be a equivalent solution to the classic 2 camera workflow basically all studios do in one way or another, it cant just be taken away and not given anything in return.
Every game needs UI and many games use first person as well.

You can still render a camera to a render texture. Espicially regarding UI, this should solve your problem. In the camera settings you can also define which the volume layer is the camera uses.

Currently, for me at least, using a render texture in HDRP causes massive amounts of garbage collection for some reason (by default). I've tried adjusting several settings on the render texture (size, depth use, aliasing, etc...) but the performance is still horrendous.

In my opinion this is simply not a viable, real option. This is another thing I hope Unity fixes in 2019.3.


Did you try the new incremental garbage collector? There is a boolean for it in the build: "Player Settings" under "Other Settings".

Doing some experimenting on how to do this - what it seems to boil down to is the intended workflow seems to be to use the Render Pass setting on the material. For canvas UI this means creating a Canvas UI material + Shader with that renders in After Post-process with no z-test.

Here is a minimal shader graph example based on HDRP/Unlit that will render a canvas with alpha. Note it is important that the texture input is referenced as _MainTex. The render pass must be set on the material.

5381640--545211--upload_2020-1-17_9-46-24.jpg

For this screen shot I've jacked up the bloom to prove that the canvas is rendered after post-porcess and placed the canvas half way into the floor to prove that it's rendered on top of geometry. The canvas its self is in world space mode.

I tried this with the new XR packages + Windows MR headset and it appears to be working. I have not tested TAA.

For more general information about creating a Canvas shader, I found this thread helpful: https://discussions.unity.com/t/731946

However I still have a problem that TextMesh Pro shaders (or third party shaders) don't seem to be possible be set up this way. The ultimate solution may be to move the entire UI to a custom render pass. But that's a little beyond my skill level..

1 Like

After trying use Unlit shader to render UI with Mask without success.
I found I can use Custom Pass to render UI with Mask without Post Processing.

1.Enable Custom Pass
2.Create a Custom Pass volume and add a DrawRenderersCustomPass.
3.Set Injection Point to After Post Process.
4.Set Queue to Transparent
5.Set Layer Mask to which your UI is.
6.Set Sorting to Common Transparent.

There are bugs if you build without Development Build.
Screen will turn black.
https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/5429

5388792--546408--ui.jpg

7 Likes