Search Unity

LWRP + PP, how to skip antialiasing on UI?

Discussion in 'Image Effects' started by n-gist, Jun 17, 2019.

  1. n-gist

    n-gist

    Joined:
    Mar 7, 2016
    Posts:
    41
    Hey! I need to create custom fullscreen postprocessing effect that applies over resulting screen texture, but
    when i switch UI canvas render mode from Screen Space - Overlay to Screen Space - Camera, or World Space, to make UI be affected by postprocessing stack, antialiasing settings on Post Process Layer starts affecting UI, and switching moment is very noticeable.
    I want the 3D scene to be antialiased, but interface to be crisp like when canvas rendering mode is set to Screen Space - Overlay, and affect them by postprocess effect together. I am using LWRP. Is it possible? It works if Quality AA setting is used (MSAA), but can I do this with PP AA?
     
    Last edited: Jun 17, 2019
  2. n-gist

    n-gist

    Joined:
    Mar 7, 2016
    Posts:
    41
    I found that 2019.2 will have camera stacking support, it will solve this.
    For now i created second camera rendering all but UI layer to render texture, and main camera rendering only UI layer, having Raw Image in UI that uses material with render texture second camera is rendering.
    So i have two posprocessing layers, one is affecting 3d and have AA on, second is affecting ui + 3d. But definitely will switch this to 2019.2 stacking workflow.
     
  3. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    did you find a solution?
     
  4. n-gist

    n-gist

    Joined:
    Mar 7, 2016
    Posts:
    41
    Hi. I made a fullscreen "UI / Raw Image" for camera that renders UI. It sits as background under other UI elements and it uses "Universal Render Pipeline/Unlit" material to render a OutputTexture from second camera which renders 3D objects. Its little bit complicated setup and needs scripting cuz it needs to re-create render target during viewport resizing and on application start, disposing on shutdowns to prevent memory leaks, updating raw image material source and so on.
    But URP 7.2.0 has Camera Stack functionality that should do this. I didn't checked it yet.
     
  5. SplenShepard

    SplenShepard

    Joined:
    Aug 24, 2019
    Posts:
    20
    The URP camera stack unfortunately does not allow different AA settings for stacked cameras; the AA settings can only be applied to the base camera. We're running into a problem right now where the MSAA at 8x from URP is affecting UI elements (white diagonal line across the center of rects). Any update here would be appreciated