透明度调整Shader
原创
©著作权归作者所有:来自51CTO博客作者幻世界儿的原创作品,请联系作者获取转载授权,否则将追究法律责任
欢迎加入Unity业内qq交流群:956187480
Shader "Hsj/AlphaSetting" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_TransVal("Transparency Value",Range(0.01,1)) = 0.5
}
SubShader{
Tags{ "RenderType" = "Opaque" }
LOD 200
//alpha参数;
CGPROGRAM
#pragma surface surf Lambert alpha
sampler2D _MainTex;
float _TransVal;
struct Input {
float2 uv_MainTex;
};
void surf(Input IN, inout SurfaceOutput o) {
half4 c = tex2D(_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.r*_TransVal;//c.g || c.b
}
ENDCG
}
FallBack "Diffuse"
}
欢迎加入Unity业内qq交流群:956187480