Camera Stacking (URP) - How to apply different post processing to the UI?

I am testing out camera stacking in the URP (7.2.1). I am wondering what setup I need to apply different post processing to my UI.

  • Base camera that has global post processing (bloom, color correction etc).
  • Overlay camera that will be just for UI (and added to the base camera stack).

I would like the post processing from the base camera to not effect this camera so that I can apply a small amount of bloom to the UI. I am not sure how to do this (I would think with layers? but couldn’t get that to work).

Thanks

You can set layer masks that the Volume works for, so you can have multiple volumes, and different ones for the UI.

You may need to re-order your camera stack a bit.

3 Likes
  1. Set the layer of your Volume for the UI to e.g. UI.
  2. On the Overlay Camera set Environment > Volume Mask to e.g. UI (the hover help – see picture below – is quite helpful).

P.S: Also, what Moritz said :slight_smile:

3 Likes

What works: UI layer on top of the game layer, turn UI-cam post processing off and game-cam post processing doesn’t affect it.

To have separate post-processing effects on overlay UI-camera and base-game camera works in a very limited manner. Effects supported for overlay cameras appears to be: tone mapping mode, post-exposure-value, bloom and vignette, maybe some more, but could’t get it to adjust hue/contrast/color-values for overlay cams. This works only in the base cam volume.

Do let me know if you get this working somehow, would love to be able to adjust these individually for each overlay camera before stacking them together. (Right now I got a hunch that I’ll need to learn stencil-buffer/depth masking to get the look I’m after.)

3 Likes

is there a way to get the UI to be on an overlay camera without PP and still take depth into account so it behind objects it should be (they are rendered on the base camera)

2 Likes

Hey Everyone!
I stumbled upon this, and it helped me kind of. But I still have the issue, that the UI Post-Processing Volume is also affecting the Background Objects.

My setup is the following:
Default cam with layer-tag “Default” and also volume mask set to “Default” (Base Camera)
UI cam with layer-tag “UI” and also volume mask set to “UI” (Overlay Camera added to the camera-stack of the default cam)

One global volume with “Default” layer-tag and one with “UI”.

My UnityVersion is: 2019.4.11f1

1 Like

I’m also trying to solve this. Any idea?

One way is via Render Textures + Raw Images, but they don’t look really good, it affected the quality and there are issues with semi-transparency with that method.

Tried stacked camera approach with different culling mask and different volumes. All fine, except the shadows.
My case is motion blur for racing game with car w/o blur and all env is with blur.
Playing with sandbox scene, here is video from reddit: Reddit - Dive into anything

And ideas how to add shadows are welcomed. If it’s only able to do it with digging into custom rendering features, plz post any refs to similar example.

Thank you!

1 Like

Have you ever solved this? I have the same issue. The overlay works fine, effects get applied to all layers. But the PP effect of the overlay, also affects object below it

1 Like

same issue here. any solution out there?

1 Like

There is no out-of-the box solution as the PostProcess logic applies on the _CameraColorTexture which is actually the rendering result of both the Base and the Overlay cameras.

The easiest(least coding) solution is to have both of the cameras as BaseCamera. The original Overlay camera rendering to a RenderTexture with the PP applied and then render the RenderTexture as a UI raw image on the BaseCamera. I have to warn though that this is not very performant and is also a hassle to setup.

The better solution involves implementing a custom renderer for the original Overlay camera, making it a base camera that applies the PP onto the rendering results of the camera only before taking blending with the results of the original Base camera.

1 Like

hello and happy holidays!
i’ve been trying to figure out this different-PPVolume-per-camera situation and the latter approach you brought up seems to be the most sensible, but i don’t really know how to pull it off.
i’m not asking for full straight up code, just hope you could explain how to go about placing the overlay camera image on top of the base one, whilst making sure the PP is applied before the images get overlaid, and also, how does a custom renderer play into all this and what should it do differently than the standard one.
sorry for the probably noobish questions, i’ve just transitioned to URP and i feel like 2014 me again, trying to figure out what’s the difference between a shader and a material.
thanks for the post, and again, happy holidays!

I’ve decided to create a new thread for this issue, since multiple other ones are yet to find a proved solution. I’ve notified the other threads and hopefully if someone does come up with a working work-around, you’ll find it there.

4 Likes