Shader error in 'Custom/reflection_bump_lightmap': Program 'frag_surf', cannot locate suitable resource to bind parameter "_ShadowCoord" at line 73
Keywords: DIRECTIONAL, LIGHTMAP_OFF, DIRLIGHTMAP_OFF, SHADOWS_SCREEN
“doesn’t have (…)” tends to show up less if you don’t have an object selected that uses the shader.
Yeah, the location of the error also tends to be inaccurate. I think it refers to a compiled version of the code we don’t see.
“Cannot locate suitable resource to bind parameter”
It might have exceeded the maximum number of allowed interpolators/ semantics. (Do I remember that right?)
INTERNAL_DATA breaks down into 3x float3 for transforming tangent-space to world-space.
Shadows and lighting require another 2 entries and are automatically added by Unity.
So once Unity’s finished with it, what it actually looks like is;
struct Input {
float2 uv_MainTex : TEXCOORD0;
float2 uv_BumpMap : TEXCOORD1;
float2 uv2_LightMap : TEXCOORD2;
float3 worldRefl : TEXCOORD3;
float3 TtoW1 : TEXCOORD4;
float3 TtoW2 : TEXCOORD5;
float3 TtoW3 : TEXCOORD6;
_LightCoord : TEXCOORD7; _ShadowCoord : TEXCOORD8; < This one is too many for it to handle, you only get 8, which is 0-7.
}
So you need to find a way to remove one of those entries from the struct…
If you’re rolling your own vertex shader, you could combine your uv_MainTex and uv_BumpMap into one float4, rather than 2 float2s.
However, chances are that your normal map uses the same UVs as your diffuse map. So you can just remove float2 uv_BumpMap;
from your struct and then sample the normal map using o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));