【发布时间】:2015-09-22 16:45:39
【问题描述】:
我一直在试验战争迷雾。我一直在关注这个tutorial,显然这是unity 4,我正在使用unity 5,我目前遇到了这个错误:
未找到表面着色器顶点函数“vert”
我阅读了这个 youtube 视频的评论部分,我关注了他们,但它给了我错误。尝试了原始版本(视频中的那个),但它使我的飞机始终处于下方,即使它的 y 轴为零,主地图的 y 轴为 -10。
顺便说一句,这是我的着色器代码:
Shader "Custom/FogOWarShader" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Transparent" "LightMode"="ForwardBase" }
Blend SrcAlpha OneMinusSrcAlpha
Lighting Off
LOD 200
CGPROGRAM
//#pragma surface surf NoLighting Lambert alpha:blend --the one that makes the map always on top
#pragma surface surf Lambert vertex:vert alpha:blend
fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, float aten){
fixed4 color;
color.rgb = s.Albedo;
color.a = s.Alpha;
return color;
}
fixed4 _Color;
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 baseColor = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = _Color.rgb * baseColor.b;
o.Alpha = _Color.a - baseColor.g;
}
ENDCG
}
FallBack "Diffuse"
}
【问题讨论】: