2,537
社区成员
发帖
与我相关
我的任务
分享
Shader "lcc/Bumped Diffuse" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
_Illum ("Illumin (A)", 2D) = "white" {}
_BumpMap ("Normalmap", 2D) = "bump" {}
_EmissionLM ("Emission (Lightmapper)", Float) = 0
_ForwardLength("Forward",Float)=0
}
SubShader {
Tags{"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="Transparent"}
Cull off
// ZWrite off
// ZTest LEqual
CGPROGRAM
#pragma surface surf Lambert alpha vertex:vert
sampler2D _MainTex;
sampler2D _BumpMap;
sampler2D _Illum;
fixed4 _Color;
float _ForwardLength;
struct Input {
float2 uv_MainTex;
float2 uv_Illum;
float2 uv_BumpMap;
float3 vertPos;
};
void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input,o);
o.vertPos = v.vertex;
}
void surf (Input IN, inout SurfaceOutput o) {
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
fixed4 c = tex * _Color;
o.Albedo = c.rgb;
o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a;
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
if(IN.vertPos.z>_ForwardLength){
o.Alpha = c.a;
}else{
o.Alpha =0;
}
}
ENDCG
}
FallBack "Self-Illumin/Diffuse"
}