float slope = 1.0-ex_normal.y;
vec4 g1=texture(texture0,ex_texcoords0*42);
vec4 g2=texture(texture1,ex_texcoords0*42);
vec4 g3=texture(texture2,ex_texcoords0*42);
vec4 g4=texture(texture3,ex_texcoords0*42);
vec4 g1full=texture(texture0,ex_texcoords0);
vec4 g2full=texture(texture1,ex_texcoords0);
vec4 g3full=texture(texture2,ex_texcoords0);
vec4 g4full=texture(texture3,ex_texcoords0);
g1=mix(g1,g1full,0.2);
g2=mix(g2,g2full,0.2);
g3=mix(g3,g3full,0.2);
g4=mix(g4,g4full,0.2);
outcolor = g1;
outcolor = mix(outcolor,g2,smoothstep(0.0,0.05,slope));
outcolor = mix(outcolor,g3,smoothstep(0.01,0.125,slope));
outcolor = mix(outcolor,g4,smoothstep(0.125,0.26,slope));