Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question HDRP Shaders for UI elements

Discussion in 'Shader Graph' started by buganat, May 6, 2021.

  1. buganat

    buganat

    Joined:
    Apr 26, 2020
    Posts:
    6
    Hi all. I'm trying to user shaders with materials for UI objects. This works with the URP with Sprite Lit/Unlit Shader, but HDRP doesn't have those shaders, and none of the others seem to work. The effect only shows in scene view, not game view. Unfortunately, most tutorials on youtube only cover URP as well (even the ones that say they cover HDRP).
    Here's an image example.

    Using a simple color setting to demonstrate the difference. URP is using Sprite Unlit, and HDRP is using regular Unlit (because there is no Sprite Unlit in HDRP). I'd like to do more complex effects with UI sprites through shaders, and it seems to be possible with URP. Is there something I'm doing wrong with HDRP?

    (This is also with Screenspace Overlay. The difference is fixed with Screenspace Camera, but then it's no longer an on-screen UI and comes with several other issues as well.)
     
    Last edited: May 6, 2021
    edsludden likes this.
  2. lloydmarquart

    lloydmarquart

    Joined:
    Jul 31, 2018
    Posts:
    3
    Hi, running into the same problem right now. Did you find a solution back then?
     
  3. JJRivers

    JJRivers

    Joined:
    Oct 16, 2018
    Posts:
    137
    A month goes by, i can't get any shader to not turn red and otherwise flicker (only appears as flickers when moving mouse outside of the gameview) or glitch with UI material shaders in HDRP with 2020.3.19f1 (or 2021.2 but can't recall specific version right now). I'm going to be in need of some nicer looking UI shaders without resorting to any hacky business. It would be nice if someone could atleast point us in the right direction as to what the issue is.
     
  4. SteveTheodore

    SteveTheodore

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    12
    Quick update -- this somehow fell off the radar in the fall, but it's a real bug and is in the bug tracker now.

    In the meantime, I was able to get get it working by switching the canvas to screenspace-camera mode.
     
    scorpioservo and DavidZobrist like this.
  5. StickyTommie

    StickyTommie

    Joined:
    Oct 23, 2019
    Posts:
    13
    Could you link the Issue Tracker? I couldn't find it
     
    mmcveigh33 likes this.
  6. Deleted User

    Deleted User

    Guest

    Is this still an issue?
     
    mmcveigh33 likes this.
  7. HECer

    HECer

    Joined:
    Mar 17, 2013
    Posts:
    46
    Does someone has a solution to it? I am on 2021.3.17f1 and still feel helpless about it
     
    Alliness likes this.