Search Unity

Transparency shader with alpha from greyscale image? - Newbie question

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

  1. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    [Solved] via https://answers.unity.com/questions/806040/shader-separate-alpha-texture-independent-offset.html

    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