Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How can I make post-processing effects affect the UI?

Discussion in 'UI Toolkit' started by SimonSanchezArt, Apr 30, 2022.

  1. SimonSanchezArt

    SimonSanchezArt

    Joined:
    Dec 13, 2019
    Posts:
    3
    I have a custom post-processing script on my camera that uses OnRenderImage().
    It works on the old UI system if the Canvas is set to Screen Space - Camera.

    I'm not finding a similar setting in the new UI Builder, how can I do this? Thanks
     

    Attached Files:

  2. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    970
    At this time, UI Toolkit only provides the equivalent of the Canvas' "Screen Space - Overlay" mode. This means that UI Toolkit will be renderer after the cameras.

    What kind of camera effects would you like to be applied on your UI? In many cases, you can work around this limitation by having your PanelSettings configured to render in a RenderTexture, then draw the RenderTexture on a quad as a GameObject.
     
  3. SimonSanchezArt

    SimonSanchezArt

    Joined:
    Dec 13, 2019
    Posts:
    3
    That is what I ended up doing! Render the UI to a render texture and then using a RawImage on the old UI system instead, that worked.

    The effect is a custom post-processing that indexes/forces the colors to a defined palette
     
    mcoted3d likes this.
  4. NymThePseudo

    NymThePseudo

    Joined:
    Oct 12, 2014
    Posts:
    4
    Sorry for necroing, but is there an estimate for when UI Toolkit might support the equivalent of 'Screen Space - Camera'? Perhaps this functionality has been added in the meantime and I'm just not aware of it.
     
  5. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    529
    NymThePseudo likes this.