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

Unity UI Draw Graphic with color alpha 0

Discussion in 'UGUI & TextMesh Pro' started by Piflik, Jun 13, 2022.

  1. Piflik

    Piflik

    Joined:
    Sep 11, 2011
    Posts:
    291
    I am using a shader for a special effect on an UI image. I use the alpha channel to control part of the effect. I noticed that Unity doesn't draw the image, if its color has alpha = 0, even if I don't use that value in the shader for transparency.

    Is there a way, a flag I can set in the shader, or something else, to disable that feature? Draw the UI element even though its color alpha is 0?

    Edit: I know there is a bool in the Canvas Renderer component, but I'd reather have it on a per material basis.
     
    Last edited: Jun 13, 2022