Shader Issue with WorldReflectionVector

Hi Guys,

Recently got into Unity shader programming and I have been following tutorials from Unity Shader Cookbook. I am currently doing this tutorial and trying to get it to work on Mobile. However, I continually get the error “Too many texture interpolators would be used for ForwardBase”. After some googling I have come short with nothing. My understanding is that I have too many uv maps in my Input struct. I have tried removing the uv_NormalMap and still the same error.

Looking at the compiled shader I believe the offending code is:

/*// Too many texture interpolators would be used for ForwardBase pass:
#ifdef LIGHTMAP_OFF
struct v2f_surf {
  float4 pos : SV_POSITION;
  float2 pack0 : TEXCOORD0;
  fixed4 TtoW0 : TEXCOORD1;
  fixed4 TtoW1 : TEXCOORD2;
  fixed4 TtoW2 : TEXCOORD3;
  fixed3 lightDir : TEXCOORD4;
  fixed3 vlight : TEXCOORD5;
  float3 viewDir : TEXCOORD6;
  LIGHTING_COORDS(7,8)
};

But I have no idea where it is all coming from.

My current shader looks like this:

Shader "Marks Tests/Mobile/Cubemap Reflection Transparency Bumpmap" {
 
 	Properties {
		_MainTex ("Base (RGB)", 2D) = "white" {}
		_Cubemap ("Cubemap", CUBE) = "" {}
		//_ReflMask("Reflection Mask", 2D) = ""{}
		//_AlphaMap("Alpha Map", 2D) = "white" {}
		_NormalMap ("Normal Map", 2D) = "bump" {} 
		
		_MainTint ("Diffuse Tint", Color) = (1,1,1,1)
		_ReflAmount("Reflection Amount", Range(0.01, 1)) = 0.5
		//_Trans ("Transparency", Range(0, 1)) = 0.5
	}
	
	SubShader {
		Tags { 	"RenderType"="Transparent"
				"Queue"="Transparent" }
				
		ZWrite OFF
		//CULL OFF
		LOD 200
		
		CGPROGRAM
		#pragma surface surf BlinnPhong exclude_path:prepass noforwardadd alpha
		#pragma debug

		sampler2D _MainTex;
		samplerCUBE _Cubemap;	
		//sampler2D _ReflMask;
		//sampler2D _AlphaMap;
		sampler2D _NormalMap;
		
		float4 _MainTint;
		float _ReflAmount;
		//float _Trans;

		struct Input 
		{
			float2 uv_MainTex;
			//float2 uv_NormalMap;
			float3 worldRefl;
			INTERNAL_DATA
		};

		void surf (Input IN, inout SurfaceOutput o) 
		{
			half4 c = tex2D (_MainTex, IN.uv_MainTex);
			float3 normals = UnpackNormal(tex2D(_NormalMap, IN.uv_MainTex)).rgb;
			
			o.Normal = normals;
			// Commenting out this line allows the shader to compile. 
			// I assume WorldReflectionVector has something to do with it.
			o.Emission = texCUBE( _Cubemap, WorldReflectionVector(IN, o.Normal ) ).rgb * _ReflAmount;
			
			o.Albedo = c.rgb * _MainTint;
			o.Alpha = 1.0f;
		}
		ENDCG
	} 
	FallBack "Specular"
}

All help is greatly appreciated.

Edit: Fixed code block.

Add “#pragma target 3.0” like so

 #pragma surface surf BlinnPhong exclude_path:prepass noforwardadd alpha
 #pragma debug
 #pragma target 3.0

The shader model you are using doesnt like sampling that many textures