Search Unity

Question ShaderGraph 12.1, Overlay Canvas and UI Image (No transparency)

Discussion in 'Shader Graph' started by AllanSmithZ3, Jan 7, 2022.

  1. AllanSmithZ3

    AllanSmithZ3

    Joined:
    May 21, 2019
    Posts:
    23
    Hi!

    I have this very simple shader that basically just scrolls the UV over time which I was using for an animated background in my UI, on an Image component. It was working on URP 10, Unity 2020.3.13, but I was attempting to upgrade my project to Unity 2021.2.7 (latest as of today), which in turn upgraded URP to version 12.1.2, which apparently broke this very simple shader.

    The problem I am having now in this version is that no matter what I do, I cannot make a shader that makes the UI Image transparent on an Overlay Canvas... setting a transparency to the UI Image is making it go black instead of transparent. I've read a few posts about this, such as:
    https://forum.unity.com/threads/shader-graph-ui-image-shader.628111/
    https://forum.unity.com/threads/something-wrong-with-ui-shader-graph.1117864/

    But those are a bit old by now, and had no luck with this new version. As mentioned the shader was previously working normally on the Overlay Canvas. Switching to a Camera Canvas does solve the issue but I'd like to avoid doing that.

    Could anyone shed some light as to why this is happening? Im a shader noob to be honest so I imagine there are forces I don't really understand at work, which is why its being hard to find whats going wrong.

    Btw, this is the shader graph I have. If the canvas is set to Overlay:
    Transparency-UIImage.png

    If the canvas is set to Camera (with a camera):
    Transparency-UIImage-CameraCanvas.png

    Any help is appreciated!