Search Unity

Feature Request Post Processing with multiple cameras is currently very problematic

Discussion in 'Universal Render Pipeline' started by dev_34Disorder, Dec 26, 2020.

  1. sambahadori

    sambahadori

    Joined:
    May 3, 2018
    Posts:
    1
  2. cmdexecutor

    cmdexecutor

    Joined:
    Sep 30, 2014
    Posts:
    21
    I was just playing around with the most trivial approach: rendering a weapon with overlay camera to prevent wall clipping, the weapon looks like it exists in the separate universe as it has to stay without any postprocessing because of the issue
    Let's say we use a water volume, when you dive in the underwater effects are having to not be applied for the weapon camera
     
  3. eyalfx

    eyalfx

    Joined:
    Oct 8, 2010
    Posts:
    108
  4. cmdexecutor

    cmdexecutor

    Joined:
    Sep 30, 2014
    Posts:
    21
    For my simple case I've found a lazy workaround with 3 cameras:
    1. main cam, no post processing at all, renders all except weapon & UI layer
    2. weapon cam, applies post processing, renders only weapon layer
    3. UI cam, no post processing, UI layer
    that way UI camera still can't do postprocessing because it will be applied for all the underlying cameras but at least it won't multiply the effects for the main camera
     
  5. 1000Nettles

    1000Nettles

    Joined:
    Aug 25, 2013
    Posts:
    3
  6. dnomn8r

    dnomn8r

    Joined:
    Nov 15, 2012
    Posts:
    13
    I did get postprocessing working with multiple compositional cameras using semething similar to this.

    https://github.com/sugi-cho/Unity-URP-PostProcessing-With-Alpha

    The code there is for an older version of Unity, and you need to change the texture names it uses. But it IS possible to get it to work. Why it doesn't work out of the box? No idea.
     
    Hellfim likes this.
  7. termway

    termway

    Joined:
    Jul 5, 2012
    Posts:
    80
  8. PercyParache-I3

    PercyParache-I3

    Joined:
    Sep 8, 2022
    Posts:
    1
  9. hurleybird

    hurleybird

    Joined:
    Mar 4, 2013
    Posts:
    258
  10. Veuch

    Veuch

    Joined:
    Feb 4, 2020
    Posts:
    5
  11. MrLW

    MrLW

    Joined:
    Jun 4, 2013
    Posts:
    2
  12. RuslanVI

    RuslanVI

    Joined:
    Oct 18, 2019
    Posts:
    3
  13. Pixelroz

    Pixelroz

    Joined:
    Jan 22, 2014
    Posts:
    1
    I'm honestly shocked such an essential feature as different post processing for different cameras for URP still hasn't been solved after all these years. This is so frustrating with barely any communication from Unity other than they're looking into it. Is a solution coming soon or are we going to have to wait 3 more years? Please update us Unity!
     
  14. SertanC

    SertanC

    Joined:
    May 8, 2020
    Posts:
    1
    The first time I encountered the problem, I used Google to find a solution.
    I was first reassured to find a thread that had reported this problem almost 2 years ago. I jumped to the last page of the thread and was shocked to find it still not working..

    .. +1
     
    ExtraCat likes this.
  15. altugs

    altugs

    Joined:
    Jan 14, 2017
    Posts:
    17
  16. cficara

    cficara

    Joined:
    Sep 27, 2017
    Posts:
    35
  17. DrydenMeints

    DrydenMeints

    Joined:
    Sep 26, 2021
    Posts:
    3
  18. Raffin

    Raffin

    Joined:
    Aug 11, 2015
    Posts:
    2
  19. frotagonist

    frotagonist

    Joined:
    May 15, 2020
    Posts:
    7
    Has this been fixed yet? Anyone found a solution?

    Edit - In my case I found the solution was to only apply post processing to the overlay camera. This prevents it from double stacking the post processing.
     
    Last edited: Dec 30, 2022
  20. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,063
    +1
     
    Last edited: Jan 6, 2023
  21. Pedrooou

    Pedrooou

    Joined:
    Mar 7, 2022
    Posts:
    1
    Hi! I was having trouble with this too, and found a way to solve this :)
    First of all, set up 2 cameras, one with the (in this example) map, and another one with the character hand or gun (still in the example.)
    upload_2023-1-6_14-40-44.png
    in the right, i put the main camera, with the default layer;
    in the left, i put the character gun/hand camera, in the same position of the main one and as child of it.

    As you can see, the guns camera have the priority of 0 (zero), and the main camera have the priority of -1, this is
    important for the guns camera appear over the main one on the game view.

    upload_2023-1-6_14-43-12.png
    Now, in the Environment settings, set the main camera to whatever you're using (skybox, etc) and set the "guns" camera to uninitialized.

    note: the twos cameras are in base rendering mode upload_2023-1-6_14-45-3.png

    And that's all!
    This worked really well for me in my fps game, i hope this works for you too :)
     
  22. dedemonn

    dedemonn

    Joined:
    Oct 6, 2020
    Posts:
    5
    +1

    Can't believe I won't be able to have bloom effect on my UI camera. :(
     
  23. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    I guess for any serious use case when you lack of acknowledge about computer graphics, URP it's simply unusable.
    Unity is great for tutorial or small project to show-off or to find a job, which is what official do all days, not making serious game but advertise and prosperous in economy. It's not even suitable for prototype because lack of hot-reload or script language support unlike other engines.
    Every new package they release recently is broken toy.
    So disappointed to realize this after many years.
     
  24. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,063
    I rather think it's the opposite. Any team large enough to have a graphics engineer can work around these issues. Multiple people with the required skills already have demonstrated various workarounds for the many URP issues.

    I see it as Unity moving past their indie roots, their new tooling is increasingly aimed at large studio workflows and it's likely why these issues go unaddressed for years because it's not a problem for the studios that make Unity the most money.
     
  25. AlundraFlint

    AlundraFlint

    Joined:
    May 3, 2016
    Posts:
    6
    +1
    It would've worked with camera stacking if you could choose a custom renderer for your overlay camera
     
  26. F4bs

    F4bs

    Joined:
    Apr 23, 2019
    Posts:
    19
    i dont think they give a S*** enough honestly. would have been long done by now
     
  27. guitarguruu

    guitarguruu

    Joined:
    Jun 6, 2020
    Posts:
    11
    How is this still an issue?
     
  28. Hanh-DungSBE

    Hanh-DungSBE

    Joined:
    Oct 18, 2022
    Posts:
    1
  29. skylinx

    skylinx

    Joined:
    Nov 1, 2012
    Posts:
    3
    Hey is this still not possible? All I want is Bloom to apply on my UI but Color Grading and Depth of Field not to.
    Why is it so difficult to do this in URP?
     
    Claytonious likes this.
  30. d0dler

    d0dler

    Joined:
    Mar 31, 2020
    Posts:
    1
    +1
    We REALY need this feature. It's a shame that it is still not implemented.

    My use case:
    I'm developing a 2D Side-Scroller game and I wanted to blur the background with the depth of field Post Processing effect. The problem is that I have another Layer even further in the background for the Sun and Clouds which is also affected by the Post Processing effect.
    Sun and Clouds are captured by the base camera.
    The background (some mountains) is captered by an overlay camera with the wanted Post Processing effect.
    The foreground where the player walks on is captured by a second overlay camera.
    The Post Processing effect of the first overlay camera is also affecting the base camera, which should not happen.
     
  31. doseon

    doseon

    Joined:
    Mar 17, 2021
    Posts:
    39
  32. musicdeveloper

    musicdeveloper

    Joined:
    Oct 16, 2019
    Posts:
    68
  33. dv_Kim

    dv_Kim

    Joined:
    Jan 6, 2022
    Posts:
    1
  34. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,063
    Why the hell even a local post processing volume of the Base camera is applying on my UGUI Camera that has post processing disabled entirely? It's the most basic use case, and the system fails already for WorldSpace UI.
     
    Last edited: Feb 4, 2023
    Unifikation likes this.
  35. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    Cameras stack everything above them first. Post processing is applied afterwards. Therefore it's applied to everything above too, since that's visible in the current camera.
     
  36. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,063
    That doesn't track because Post Processing gets multiplied by every Camera in the stack. If I disable my UI Camera (set as Overlay), the overall post processing visibly changes. UI Camera has post processing disabled, culling mask set to UI only, volume mask set to Nothing, the camera doesn't reference any post processing volumes. Even if it applied post processing after both cameras are rendered, the UI camera still multiplies post processing for no reason.

    Not only I can't skip applying post processing to WorldSpace UI and SreenSpace - Camera Canvas UI, I can't stack cameras in general with any kind of post processing use.

    EDIT: The solution in the end was to not use Camera stacking at all, set all UI Canvas to Overlay, then set UI's position and scale to mimic that of WorldSpace UI. This is the only way I can have interactive UI in WorldSpace without post processing being applied on it. A lot more code, and some performance cost due to needless Update() but it works at least.
     
    Last edited: Feb 4, 2023
  37. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    258
  38. aureleph

    aureleph

    Joined:
    Jul 5, 2017
    Posts:
    1
  39. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    700
  40. Unideer

    Unideer

    Joined:
    Feb 24, 2023
    Posts:
    21
  41. PinkSakuraStudios

    PinkSakuraStudios

    Joined:
    Jan 20, 2023
    Posts:
    1
    Just add this finally jesus
    +1
     
  42. op_unity374

    op_unity374

    Joined:
    Jul 12, 2022
    Posts:
    3
    +1 A solution this would be great. It's especially troubling for AR, since it means we can't apply post processing to our scene without affecting the camera feed as well. This severely limits our ability to adjust lights/darks or apply bloom to match the camera feed, and the workarounds are quite complex and heavy.
     
  43. unity_ppJygLUWRuemag

    unity_ppJygLUWRuemag

    Joined:
    Aug 2, 2018
    Posts:
    1
    +1, this is making my head spin
     
    Unifikation likes this.
  44. bartoszbizon97

    bartoszbizon97

    Joined:
    Jan 28, 2021
    Posts:
    1
    Hey For my this settings of cameras work for separate render Post Processing only for one camera
    Base Camera - With Post Process Settings remeber to set Environment Volumes - Everything
    Overla Camera - Without Post Process remeber to set Environment Volumes - Nothing
    upload_2023-3-13_15-51-3.png
    upload_2023-3-13_15-51-26.png
     
  45. austinborden

    austinborden

    Joined:
    Aug 5, 2016
    Posts:
    24
  46. JermBot

    JermBot

    Joined:
    Nov 3, 2021
    Posts:
    3
  47. JermBot

    JermBot

    Joined:
    Nov 3, 2021
    Posts:
    3
    Hey all, I might have a work around. I believe it might have been suggested before but you can use a render texture to then put on a raw image.

    1. Create your base camera. This should have post-processing on. Under environment set the volume mask to default or some layer that will have your main effects.
    2. Create a global volume that is on layer that your main camera is on. Have your main effects here
    3. Create second camera, set it to have a volume mask of UI (in my case I want UI to have different effects). DO NO ENABLE POST PROCESSING. Set the culling mask to only UI and have a solid background. Set the output to a render texture. Make sure the render texture is the same dimensions as the UI canvas scaler reference resolutions we make below.
    4. Create the UI, make the canvas be Screen Spcae - Camera and set the camera to be the second camera we made.
    5. Create a canvas with a image that spans the whole screen. Put the render texture into the image.
    7. Create another global volume BUT HAS LAYER OF UI. This is your volume with UI

    Very hacky, but I've been able to have UI effects different than the base camera's effect. I have only seen a few frame drops using this solution. I'm not sure why the second camera cannot have post processing on but it probably has to do with this alpha problem. Let me know if this helps or need more clarifications, I'm not great at making instructions.
     
    Last edited: Mar 26, 2023
    assertor likes this.
  48. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    I am currently experiencing an issue with the TextMeshPro World Canvas due to FXAA Anti-Aliasing, causing the text to appear blurred. Unfortunately, the only solution I have found so far is to disable Anti-Aliasing completely, which is not ideal.

    I have attempted to create an Overlay Camera specifically for the UI in an effort to disable Anti-Aliasing solely on that camera, but have been unsuccessful in doing so.

    Would anyone happen to have any advice or recommendations on how to address this problem? Thank you.

    upload_2023-3-29_17-26-19.png
     
    Andy608 likes this.
  49. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Hello, any updates on this?
     
    goncalo-vasconcelos likes this.
  50. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    The fact that this isn't on the roadmap (even as 'under consideration' - extremely non-committal) after 3 years of pleading and 3 years being told to 'please make a suggestion on the roadmap portal!' is downright insulting to the community.