欢迎加入Unity业内qq交流群:956187480



透明度调整Shader_扫描二维码

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