Hi guys…
I’ve got a problem with lerping the albedo term in a surface shader…
If I do
o.Albedo = lerp(o.Albedo, reflcolor.rgb, 0.3);
Everything is great, but when I replace the 3rd parameter with a calculated value the following error shows up:
Too many texture interpolators would be used for ForwardBase pass at line 12
First, I thought, it might be a problem with my Input Struct (as discussed in another thread).
But now I found that it’s just that single lerp…
Any ideas?
Alright… My problem is completely different…
Relevant parts:
My input struct:
struct Input {
float2 uv_MainTex : TEXCOORD0;
float2 uv_Bumpmap : TEXCOORD1;
float4 TtoW0Ix : TEXCOORD2;
float4 TtoW1Iy : TEXCOORD3;
float4 TtoW2Iz : TEXCOORD4;
float3 viewDir;
};
Now the relevant part of my vertex program:
o.viewDir = mul(vrotation, objSpaceViewDir);
so, I definitely write into viewDir…
Now, if I try to use the viewDir in my surface program the shader crashes, if I don’t, it compiles without errors.
I dont have a solution for your problem, but i might say that i faced the same problem with alot of different calculations with surface shaders.
Sooo, you are not alone 
Well… Doesn’t help, though it’s nice to know
.
At least I know that it’s the same issue as if you would us too many elements in your input struct.
Following my thoughts my error should be there, even if I do not use the viewDir in my surf-method, since I’m initializing it in the vert-method.
But no… Either I’m failing with my logic or Unity has some kind of unexpected behavior here.