uniform sampler2D tex;
uniform sampler2D distoffsets0;
uniform sampler2D distoffsets1;
uniform sampler2D distoffsets2;

void main()
{
	vec2 dist_r=(texture2D(distoffsets0,gl_TexCoord[0].st).xy);
	vec2 dist_g=(texture2D(distoffsets1,gl_TexCoord[0].st).xy);
	vec2 dist_b=(texture2D(distoffsets2,gl_TexCoord[0].st).xy);

	float r=texture2D(tex,gl_TexCoord[0].st+dist_r).r;
	float g=texture2D(tex,gl_TexCoord[0].st+dist_g).g;
	float b=texture2D(tex,gl_TexCoord[0].st+dist_b).b;

	vec4 outcolor=vec4(r,g,b,1.0);
	gl_FragColor=outcolor;
	//gl_FragColor=outcolor*0.05+texture2D(distoffsets0,gl_TexCoord[0].st)*0.95;
	//gl_FragColor=texture2D(distoffsets2,gl_TexCoord[0].st); //venitustekstuur
	//gl_FragColor=texture2D(tex,gl_TexCoord[0].st); //ilma venituseta
	

	}
