Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Is there a way to use two cameras with different post-processing settings?

Discussion in 'Graphics Experimental Previews' started by Ehredt, Sep 5, 2018.

  1. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    I have a small 3D object that I'm rendering in the bottom right corner, and for various reasons it's much easier for me to render it using a separate camera than my main camera, but I have a lot of chromatic aberration in the corners and they're turning my separate 3D object into a sad rainbow smudge. Is there a way for me to get rid of the chromatic aberration, but only for this camera? I've been messing with the settings for a while but nothing has worked so far. (I'm very fond of my chromatic aberration and would rather keep it if possible.) Thanks in advance!
     
    DragonCoder likes this.
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Change camera layers for this object in corner (with effects exclude layer, without effects include only this layer) and change cameras Depth property for order rendering
    upload_2018-9-5_18-32-26.png
     
  3. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    Hi! Thanks for your response. To clarify, I'm using the HDRP and my camera settings are different. (See attached screenshot.) If I turn off the post processing layer on my second camera to get rid of the chromatic aberration on my object in the corner, it seems to undo all of the post processing settings on my main camera.
     

    Attached Files:

  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    https://forum.unity.com/threads/layering-cameras.546954/#post-3642976

    Edit: Oh i saw you posted in thread from link :)
     
  5. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    580
    Why not? Each camera uses a different post layer no? The simplest solution I can think of, is use 2 volumes at the same location (or if they are global just anywhere, whatever suits you) and assign one on each camera with different post fx so you can switch between them.
     
  6. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Not in HD Render Pipeline.
     
  7. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    195
    Im assuming you are using the post process stack. You just need to create a new post process global volume and set its layer to something new. Also you need to create a new post process profile with no effects:
    PostProcess.PNG

    Then in your second camera you have to set its calling mask (if desired) and the layer of the post process;

    Cam.PNG

    This should do the trick. Of course for render order you have to check the depth under output settings as well.
     
  8. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    Thank you for your answer, but this didn't work for me. It just causes the second post-processing volume to override the first post-processing volume, which in this case means that all my post-processing effects disappear completely if the second volume exists and is used by the second camera. Am I missing something here, or is it just not possible to layer cameras with different post-processing effects in the HDRP?
     
  9. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    195
    Of course you have to cull the objects you don't want to see in the first camera. This way the first camera should render the objects of some layerA with the first post process layer and the second cam will only render objects of some other layerB with the second post process layer. I will try to build something like that tomorrow I might be wrong as well!
     
  10. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Repeat
     
  11. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    195
    Jep just tried the idea but it did not work. Weird and annoying :/
     
  12. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    Any solution for this guys? This is very frustrating. How could be that not any dev would pay attention for this??? How can we build our own projects or even test Unity if we cannot get any documentation for its proper set/working?
     
  13. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    https://forum.unity.com/threads/layering-cameras.546954/#post-3642976

    It looks like they figured it out here, although I'm not completely sure, as their solution looks like something I already tried that didn't work for my particular case.

    Anyway, I don't mind if we don't have the documentation yet -- that's a hazard of working with tools in beta. It's worth it for me right now, and it's kind of fun figuring out how to troubleshoot when I don't have everything spelled out for me yet.
     
  14. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    Hmmm... not working for me. No matter what, if I set global in a PP volume setting, all cameras has the PP effect, and impossible to separate them... :(
     
  15. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
  16. Levr01

    Levr01

    Joined:
    Jun 6, 2017
    Posts:
    26
    There is no way to use two separated post process volumes in same time. Effects just override. I heave one camera for UI and other for game view, and when UI camera heave a low depth level i dont see a UI but when UI cam is higher gepth a can see UI with the post process overrided and nothing post pro whith game view cam.