SoftMaskForUGUI/Shaders/Resources/SoftMask.shader

33 lines
523 B
Plaintext
Raw Normal View History

2018-11-20 07:49:14 +08:00
Shader "Hidden/SoftMask" {
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
Cull Off
2018-11-20 07:49:14 +08:00
ZWrite Off
2019-03-11 13:40:44 +08:00
Blend SrcAlpha One
2018-11-20 07:49:14 +08:00
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
sampler2D _MainTex;
float _Softness;
float _Alpha;
2018-11-20 07:49:14 +08:00
fixed4 frag (v2f_img i) : SV_Target
{
return saturate(tex2D(_MainTex, i.uv).a/_Softness) * _Alpha;
2018-11-20 07:49:14 +08:00
}
ENDCG
}
}
}