uniform sampler2D tex0;
uniform sampler2D tex1;
uniform sampler2D tex2;
varying vec4 position;

void main() {
	position.y = 0;
	//grass
	vec4 texColor0 = texture2D(tex0,gl_TexCoord[0].st);
	//rocky
	vec4 texColor1 = texture2D(tex1,gl_TexCoord[0].st);
	//snow
	vec4 texColor2 = texture2D(tex2,gl_TexCoord[0].st);

	if(position.y > 12.0) {
		texColor2 *= 1.0;
		texColor1 *= 0.0;
		texColor0 *= 0.0;
	} else if (position.y > 3.0) {
		texColor0 *= 0.0;
		texColor1 *= 1.0;
		texColor2 *= 0.0;
	} else {
		texColor0 *= 1.0;
		texColor1 *= 0.0;
		texColor2 *= 0.0;
	}
	
	gl_FragColor = (texColor2+texColor1+texColor0);
//	gl_FragColor.x += sin(position.x);
	//gl_FragColor = vec4(1,0,1,1);
}
