Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to limit post-processing to certain layers/cameras?

Discussion in 'Universal Render Pipeline' started by drallcom3, Jul 2, 2020.

  1. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    162
    Unity 2020.2
    URP 9.0 (the one with camera stacking)

    I have a main camera and several cameras stack on top of it. That part works very fine.
    Each camera has it's own layer, culling mask and volume mask. They all have post-processing enabled. Also HDR.

    Main camera: https://imgur.com/Qnb24gx
    Camera b: https://imgur.com/qZI2rsl
    All: https://imgur.com/qImTrls
    Volume masks says it should only affect a certain layer.
    The work bench is in layer b, rest is in layer a and default (main camera) layer is empty.

    Now all sorts of weird things happen:
    • Default volume affects the whole view, even though there's nothing in the layer.
    • Layer a has a color shift effect, but it's not visible.
    • Layer b has bloom, but the bloom is applied to the whole view. If I move the camera to earlier in the stack, only what is visible so far gets affected. It ignores any masks or layers.
    Volume mask says "This camera will only be affected by volumes in the selected scene-layers". Which is not the case.

    What is going on here?
    How can I limit post-processing to certain cameras/layers?
    Is it even possible? According to the documentation it is, but the results says no.
    What's up with camera stacking and post-processing? Sometimes it works, sometimes it doesn't.
     
  2. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    162
    Based on my tests:
    • "This camera will only be affected by volumes in the selected scene-layers". That's a lie.
    • Volumes affect the current camera and everything that has already been rendered. I can for example put a worldspaced UI at the top of the stack and it won't have bloom (or vignette). Put it at the bottom without a volume -> It gets bloom regardless.
    • Some effects only work on the main camera (like everything with colors). They also ignore the stack and get applied universally at the end. Which kind of sucks, because the worldspace UI can't avoid that effect no matter what.
    Something like "the fire has bloom but the environment not" doesn't seem to be possible, even if the tooltips suggest otherwise.
     
  3. JP7878

    JP7878

    Joined:
    Nov 25, 2019
    Posts:
    5
    Have you found a solution or potential workaround? I'm having a very similar problem. Any overlay camera with an associated post-processing effect seems to apply to the base as well.
     
  4. gmgannon

    gmgannon

    Joined:
    Sep 24, 2020
    Posts:
    6
    I'm getting something related I think. Have two cameras, one with multiple cinemachine virtual cameras. Volumes applied to virtual cameras seem to properly stay in their lanes, but the active vcam volume effects the other camera. Not sure how it's possible or how to fix. Going to try creating vcams on both cameras and see what happens.
     
  5. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    92
    Using Two camera one Base and the other(s) Overlay with the base set the post processing flag enabled and the other not and together with layers masks for the cameras will let to control the look of the scene.