Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Post Processing on second Camera going to RenderTexture is rendering ONLY the postFX contribution

Discussion in 'Image Effects' started by _EasR_, Sep 30, 2019.

  1. _EasR_

    _EasR_

    Joined:
    Jun 23, 2016
    Posts:
    6
    I'm working on a 3D project where I would like to overlay a full screen quad (right now, shaded a solid color) blocking the 3D scene, and then to selectively render objects from the 3D scene in front of the quad, along with Canvas text. I've achieved this using two cameras, layer masks and a RawImage in a canvas.

    The issue I'm facing now is that I would like to apply Post Processing to the overlay camera's objects to match what is going on in the 3D scene, but when I add a post processing V2 layer to the overlay camera, it seems to start rendering ONLY the output of the post processing with transparent pixels instead of the initial surface render.

    I am using 2019.2.3f1 with the standard renderer in Deferred mode, and the Post Processing V2 stack. All 3D and Canvas Objects are using the standard shaders.

    Could anyone kindly direct me to the correct setup to have a camera render to a RenderTexture and then apply post processing effects? I have a feeling that this could be more elegantly done via some of the render calls in the API..?

    Thanks!


    Overlay disabled and cube set to Default LayerMask:
    ImageWithoutOverlay.png
    Overlay with Post Processing:
    ImageWithOverlay_WithPostFX.png
    Overlay without Post Processing:
    ImageWithOverlay_NoPostFX.png
     
  2. _EasR_

    _EasR_

    Joined:
    Jun 23, 2016
    Posts:
    6
    I seem to have fixed it by deactivating depth of field on the second camera's post processing layer, and also changing the anti-aliasing on the second cam to something other than fxaa.

    With just changing the anti-aliasing type yet still using DOF , it's producing the result in the attached image. The blue background is a separate Canvas Image. The blue tint on the cube is semi-transparent. . . When lit more strongly it goes opaque. I'm really curious as to what in the pipeline causes this, but excited to continue with the project.

    ImageWithOverlay_noFXAA.png