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

Possible bug with LWRP + layered cameras + post processing stack?

Discussion in 'Graphics Experimental Previews' started by online_frog, May 15, 2018.

  1. online_frog

    online_frog

    Joined:
    Dec 27, 2012
    Posts:
    8
    I've been trying to get the post processing stack to work in the LWRP with the camera setup I use, and after testing it against legacy forward rendering I found out that something about the way camera compositing works in the LWRP, or maybe the way the post processing stack shaders work in LWRP makes it so you can't apply post effects to a camera of higher depth.

    Here's the setup I use- I have a camera that renders the world, and an overlay camera that renders ui + a first person viewmodel etc. (a common setup). In legacy forward rendering it works. In this test case I'm color grading a quad on the default layer to be blue, I want the capsule on an overlay layer to stay white.



    With this exact setup with the same post effect layer configurations and everything is put into a project using the LWRP, it looks like this:



    The color grading post effect seems to not be working at all, but after disabling the overlay camera completely,



    the main camera's post effects begin to start working. I'm not really sure if this is an issue with the post processing stack shader or the LWRP. If I put a post effect on the overlay camera, it'll make the capsule and the background blue, which is expected, since the post effects cascade up the cameras by depth, but this LWRP-specific behavior makes it impossible to exclude an overlay camera from being post processed.

    I imagine I can just customize the pipeline to achieve the exclude-overlay-from-being-post-processed behavior, but I'd like to know if this is some sort of unintended behavior. Thanks!
     
  2. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    244
    This issue is similar to another posted here, but in your case you need a 3rd camera to render just the FPS mesh(weapon/cockpit I assume?)

    With a setup like this you should follow this convention:
    Base scene camera:
    Normal camera, rendering all your scene minus the UI and FPS layer
    No Post Process layer
    FPS/UI camera:
    layer mask set to FPS layer and UI
    Post Process Layer
    Higher Depth than base camera

    Also both cameras should have the same HDR/MSAA settings to stack properly.

    If you want the UI on a separate 3rd camera(I suggest against as the additional cost of a 3rd camera is not worth it and post doesn't affect it by default) check the other post I linked to and then treat the FPS camera as the scene camera in that setup.

    Let me know if you have any issues setting it up.