#version 100
precision mediump float;

varying vec4 col;
varying vec3 nrm;
varying vec2 uv;

uniform sampler2D tex0;
uniform float lerp;
uniform vec4 col0;
uniform vec4 col1;

void main()
{
	float l = (	texture2D(tex0, uv).r +
				texture2D(tex0, uv).g +
				texture2D(tex0, uv).b)/3.0;
	gl_FragColor = (l < lerp) ? col0 : col1;
//	gl_FragColor = (texture2D(tex0, uv));// .r < lerp) ? col0 : col1;
}
