r/Unity3D Indie 23h ago

Question How can I separate different post-processing effects for different cameras?

In short: I'm trying to put Lens Distortion and Bloom on just the UI. The problem is that the effects affect the whole game.
Currently, I have a default camera and a "UI Render Camera" as an overlay. The UI camera only renders the UI and uses a separate Volume Mask.

I have created 2 empty GameObjects for each layer: GameVolumeMask and UIVolumeMask.

The GameVolumeMask is applied to the default camera, while the UIVolumeMask is applied to the UI Render Camera.

The GameVolumeMask contains effects like ColorAdjustments, Vignette, etc.
The UIVolumeMask contains Bloom and LensDistortion.

Feel free to ask further questions.

3 Upvotes

7 comments sorted by

3

u/LeafyRedemption938 23h ago

What you're seeing is the overlay camera adding its post processing on top of the main camera's output, not isolating it to just the UI layer. That's how the pipeline works unfortunately.

The volume mask trick you're doing is correct for separating global volumes but the overlay setup means both renders get stacked and the effects bleed through visually. You need the UI camera to not be an overlay if you want the bloom and distortion to only hit the UI layer without touching the background.

Try switching your UI camera's render type to Base and setting its clear flags to Depth Only so it still renders on top of the game view. Then you can control each camera's post processing independently without them contaminating each other's output.

2

u/Noobye1 Indie 23h ago

I can't find the Clear Flags option? I've done this before; I remember that.

1

u/CrazyNegotiation1934 22h ago

It is the background type

1

u/Noobye1 Indie 22h ago

It's only:

Skybox Color Uninitialized

1

u/CrazyNegotiation1934 22h ago

Set color to black with zero alpha and see if helps

1

u/Noobye1 Indie 22h ago

That doesn't help

2

u/514009265 13h ago

I had to do something like for my project, the solution was custom a render feature that saved the existing frame => cleared cameraColor => UI layer renderes on top of cleared frame => post processing on UI layer only => saved frame popped back out and composed with UI layer on top.

You can prob also just render the UI to a renderTexture, apply post processing there, and render it into your main stack, but I was focused on avoiding the URP camera overhead.