- Home /
Question by
pbeer · Dec 19, 2015 at 02:51 PM ·
unity 5shaderinterpolationinterpolate
Unity 5 shader error : Too many texture interpolators would be used for ForwardBase pass (11 out of max 10)
Hi,
I'm trying to use good old T4M shader in Unity 5 and it seems there is an extra interpolator in action. Is there a way to still use it without setting it to shader target 4.0?
Shader "T4MShaders/ShaderModel2/Diffuse/T4M 4 Textures" {
Properties {
_Splat0 ("Layer 1", 2D) = "white" {}
_Splat1 ("Layer 2", 2D) = "white" {}
_Splat2 ("Layer 3", 2D) = "white" {}
_Splat3 ("Layer 4", 2D) = "white" {}
_Control ("Control (RGBA)", 2D) = "white" {}
_MainTex ("Never Used", 2D) = "white" {}
}
SubShader {
Tags {
"SplatCount" = "4"
"RenderType" = "Opaque"
}
CGPROGRAM
#pragma surface surf Lambert
#pragma exclude_renderers xbox360 ps3
#pragma target 3.0
struct Input{
float2 uv_Control : TEXCOORD0;
float2 uv_Splat0 : TEXCOORD1;
float2 uv_Splat1 : TEXCOORD2;
float2 uv_Splat2 : TEXCOORD3;
float2 uv_Splat3 : TEXCOORD4;
};
sampler2D _Control;
sampler2D _Splat0,_Splat1,_Splat2,_Splat3;
void surf (Input IN, inout SurfaceOutput o) {
fixed4 splat_control = tex2D (_Control, IN.uv_Control).rgba;
fixed3 lay1 = tex2D (_Splat0, IN.uv_Splat0);
fixed3 lay1_2 = tex2D (_Splat0, IN.uv_Splat0 * -0.015);
fixed3 lay2 = tex2D (_Splat1, IN.uv_Splat1);
fixed3 lay2_2 = tex2D (_Splat1, IN.uv_Splat1 * -0.015);
fixed3 lay3 = tex2D (_Splat2, IN.uv_Splat2);
fixed3 lay3_2 = tex2D (_Splat2, IN.uv_Splat2 * -0.015);
fixed3 lay4 = tex2D (_Splat3, IN.uv_Splat3);
fixed3 lay4_2 = tex2D (_Splat3, IN.uv_Splat3 * -0.015);
o.Alpha = 0.0;
o.Albedo.rgb = (((lay1 * splat_control.r / 2) + (lay1_2 * splat_control.r / 2)) +
((lay2 * splat_control.g / 2) + (lay2_2 * splat_control.g / 2)) +
((lay3 * splat_control.b / 2) + (lay3_2 * splat_control.b / 2)) +
((lay4 * splat_control.a / 2) + (lay4_2 * splat_control.a / 2)));
}
ENDCG
}
// Fallback to Diffuse
Fallback "Diffuse"
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612053215im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unlit Transparent Shader 0 Answers
Reflections not working on IOS 2 Answers
How to use the Unity 5 Transparent Shader? 1 Answer
Objects Not Visible In Low End Computer. (Shader Error) 1 Answer
Read depth buffer on the cpu 1 Answer