uniform sampler2D colmap;
uniform sampler2D dirtimage;
uniform sampler2D dirtmap;
uniform float amount;

void main( void )
{
	vec2 xy = gl_TexCoord[0].xy;
	vec4 col = texture2D(colmap,xy);
	vec4 dirt = texture2D(dirtmap,xy);
	vec4 d = texture2D(dirtimage,xy);
	vec4 c = vec4(0);
	c = col + dirt*d*vec4(amount);
	gl_FragColor = c;
//	c = dirt*d+(vec4(1)-dirt/vec4(5))*col;
//	gl_FragColor = c*vec4(amount)+vec4(1.0-amount)*col;
	//gl_FragColor = c*vec4(amount)+vec4(1.0-amount/2.0)*col;

}

