I have this error whit my shader:
Number of Fragment Texture Image Units exceeds HW limits.
and here is the shader code:
shader_type spatial;
render_mode blend_mix;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform sampler2D grassTex : hint_albedo;
uniform sampler2D grass2Tex : hint_albedo;
uniform sampler2D grass3Tex : hint_albedo;
uniform sampler2D grass4Tex : hint_albedo;
uniform sampler2D cliffTex : hint_albedo;
uniform sampler2D cliff2Tex : hint_albedo;
uniform sampler2D cliff3Tex : hint_albedo;
uniform sampler2D cliff4Tex : hint_albedo;
uniform sampler2D sandTex : hint_albedo;
uniform sampler2D sand2Tex : hint_albedo;
uniform sampler2D sand3Tex : hint_albedo;
uniform sampler2D sand4Tex : hint_albedo;
uniform float offset : hint_range(5,35);
vec3 splating(vec2 uv,float channel,sampler2D tex1,sampler2D tex2, sampler2D tex3, sampler2D tex4)
{
vec3 result;
if (channel == 100.0)
{
result = texture(tex1,uv).rgb * channel;
}
else if (channel == 50.0)
{
result = texture(tex2,uv).rgb * channel;
}
else if (channel == 25.0)
{
result = texture(tex3,uv).rgb * channel;
}
else if (channel == 12.0)
{
result = texture(tex4,uv).rgb * channel;
}
else
{
result = texture(tex1,uv).rgb * channel;
}
return result;
}
void fragment() {
float redchannel = texture(texture_albedo,UV).r;
float greenchannel = texture(texture_albedo,UV).g;
float bluechannel = texture(texture_albedo,UV).b;
float alphachannel = texture(texture_albedo,UV).a;
vec3 red_level = splating(UV*offset,redchannel,cliffTex,cliff2Tex,cliff3Tex,cliff4Tex);
vec3 green_level = splating(UV*offset,greenchannel,grassTex,grass2Tex,grass3Tex,grass4Tex);
vec3 blue_level = splating(UV*offset,bluechannel,sandTex,sand2Tex,sand3Tex,sand4Tex);
vec3 result = red_level + green_level + blue_level;
ALBEDO = albedo.rgb * result;
}