- Home /
Question by
monsterlullaby · Dec 24, 2016 at 08:11 AM ·
shadersyntax error
Shader error syntax error help
Shader "Custom/snow" {
Properties {
_MainTex("Base (RGB)", 2D) = "white" {}
//New normal map texture
_Bump("Bump", 2D) = "bump" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Lambert
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
//Must add a sample with the same name
sampler2D _Bump;
struct Input {
float2 uv_MainTex;
float2 uv_Bump;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D(_MainTex, IN.uv_MainTex);
//Extract the normal map information from the texture
o.Normal = UnpackNormal(tex2D(_Bump, IN.uv_Bump);
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
On the line, o.Normal = UnpackNormal(tex2D(_Bump, IN.uv_Bump); there is a syntax error although I can't seem to find anything wrong with it.
Comment