I get this error all the time: Too many texture interpolators would be used for ForwardBase pass
Here is the code where the error occurs, and the line where is the error is commented out.
From an earlier thread
Itās made more difficult because unity āpadsā out the structure with internal data in some passes that get compiled behind the scenes. It you look at that struct you could pack it like this:
float4 color0lightx;
float4 color1lighty;
float4 normallightz;
and then reconstruct the 4 floats3ās. This will give you some breathing room. Pack as much data as you can
Iāve got exactly the same error here but already repacked my struct as follows:
struct Input {
float2 uv_MainTex : TEXCOORD0;
float4 TtoW0Ix : TEXCOORD1;
float4 TtoW1Iy : TEXCOORD2;
float4 TtoW2Iz : TEXCOORD3;
float4 uv_Bumpvdxy : TEXCOORD4;
float4 vdzOSN;
};
Does anybody know another solution?
Stupid solution: If youāre not targeting ancient hardware, just add ā#pragma target 3.0ā to make the shader compile to shader model 3.
Or just donāt use surface shaders if you intend to target ancient hardware, its not optimized for stonage (nor really suitable for mobile either just to mention)
Iām still curious on why it works at all without SM3 enforcement as it goes that close to the specs of SM2 that any hardware that really only supports SM2 will struggle and stutter seriously
Nice thing, thanks
But if I do that, 2 new errors appear:
Program āfrag_surfā, assignment of incompatible types at line 136
and
Program āvert_surfā, assignment of incompatible types at line 136
Best thing: There are only 108 lines of code oO
Edit:
Didnāt see dreamoraās postā¦
Well, my problem is, Iām customizing an old shader.
Unity kind of told me to rewrite it into a surface shader.
Unfortunately i cannot remember the error-message for thatā¦
No ideas on that?
Iām targeting pc only, so surface shader should work just fine I think.
I just cannot solve the errors mentioned above (assignment of incompatible types at line 136)ā¦
I do not have a line 136 - or is it the compiled shaderās line?
Getting really confused at the momentā¦
sorry to bump such an old thread, but my shader just stopped working. I compared it to an older version of the shader and the code is 1:1 the same. Only problem is that, now I get the same issue. Is there some sort of online checkups in Unity 5.6 ? And if there is, why isnāt this fixed instead?
going from 5.6 to 2019⦠the number of interpolaters has apparently gone down. some of my shaders no longer compileā¦
i fixed it by changing #pragma target 3.0 to #pragma target 4.0. can someone tell me if this will affect the performance of the game?
You can read up more about shader targets in Unityās manual:
https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html
As far as my understanding goes it shouldnāt, but the shader can be unavailable on certain (especially old) hardware, and as mentioned before because surface shaders arenāt meant to be used on mobile it can cause issues there.
digging up because I had to add #pragma target 3.5 just to add one custom float2 on top of Input with
float2 uv_MainTex;
float3 worldRefl;
Donāt understand why a basic surface shader can require 10 texture interpolators!! But I guess it is because it compiles for every possible use case including 4 textures, even I only have 1 defined?! I donāt really get itā¦
I can add/modify the vertex shader to use appdata_base or appdata_tan instead of appdata_full, which generates warnings about not supporting some use-cases (lightmaps, dynamic GI). But not an issue if I donāt use those is it?!
Unity 2019 LTS