Shader "Test" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 150
ZWrite On
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
//#pragma surface surf Lambert noforwardadd
#pragma surface surf Lambert noforwardadd keepalpha
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float4 vertexColor : COLOR;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.vertexColor;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "Mobile-VertexLit"
}
Unity Shader Example 25 (在ShaderLab Surface 添加顶点颜色与透明效果)
最新推荐文章于 2023-11-29 16:49:27 发布