使用UnityShader实现Mask边框效果
实现原理------------------------------------------------------------------------------------
- 把透明度小于阈值的像素舍弃, 缺点是锯齿很严重
- 透明度混合,需要开启透明队列
fixed frag(v2f i):SV_Target
{
fixed4 col=tex2D(_MainTex,i.uv);
fixed4 maskCol=tex2D(_MaskTex,i.uv);
//clip(maskCol.a-1); 舍弃像素,会有锯齿
col.a*=maskCol.a
}