On the left is the shader in Scene view, on the right is the same shader at the same time in Game view. The bump map isn’t rendering correctly. Any ideas?
Shader "Mobile/SkidMarks"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
[NoScaleOffset] _BumpMap ("Normalmap", 2D) = "bump" {}
_Color("Color", Color) = (1,1,1,0)
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent" "IgnoreProjector"="True" }
Pass
{
LOD 250
ZWrite Off
Blend One One
}
CGPROGRAM
#pragma surface surf Lambert alpha noforwardadd
sampler2D _MainTex;
sampler2D _BumpMap;
half4 _Color;
struct Input
{
float2 uv_MainTex;
float3 vertexNormal;
float vertexHeight;
};
void vert (inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input,o);
o.vertexNormal = abs(v.normal);
o.vertexHeight = v.vertex.y;
}
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb * _Color;
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));
o.Alpha = o.Normal * 3;
}
ENDCG
}
FallBack "Mobile/Diffuse"
}