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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Transparency shader with alpha from greyscale image? - Newbie question

Discussion in 'Shaders' started by Zante, Dec 23, 2020.

  1. Zante


    Mar 29, 2008
    [Solved] via

    I'm using a render texture to create a grayscale image which I'd like to use as the transparency parameter for a diffuse material. I'd also like to be able to apply color to the existing diffuse. The reason I'm doing this is so I can achieve some kind of performant (vitally important) soft masking effect.

    My questions are, for my own learning:
    • What additions would be required to make the _MainTex accept color, and alpha, changes from _Tint?
    • How can I ensure that, if my _MainText is darker in color, that this is rendered separately form the _Alpha input (in essence, allowing for a dark fog)?
    Last edited: Dec 24, 2020