I am using Unity 2019.1.14f1 I have the volume applied to a game object with various post effects applied which all works fine.
The problem is we have a second camera which is rendering the UI and also some 3D buttons, we want the post to not effect the UI camera and only the background on the first camera. We used to use the dont clear flag on older Unity versions which worked fine but now there is no such option.
We have tried setting the cameras layers and the volume layer mask but the post either effects no cameras or all cameras, we cannot work out how to apply the post to just one camera.
I ran into a similar issue not long ago, where I wanted different post processing on the UI camera and the main camera. Seems like layered cameras is a bit of a no-no for unity’s new rendering system, and while there were some purported solutions out there they always involved 'I don’t know why this works but…" and didn’t work for me anyway.
The way I solved it was to create a custom post process effect where I rendered a depth-only camera into a render texture, and applied it to the final image without unwanted post processing by putting it last in the stack.
OverlayRenderTexture.cs and OverlayRenderTexture.shader must be in a Resources folder.
Create a render texture to store the UI graphics.
Add SetRendTex to your UI camera and add the render texture in the inspector.
On your main camera, in the Post Process Volume click Add Effect and add Overlay Render Texture effect, set the render texture and opacity in the inspector.
I can’t provide any support for anyone who uses this, hope it helps.