#vertexshader

void main()
{
	gl_Position = ftransform();
	gl_TexCoord[0] = gl_MultiTexCoord0;
}

#fragmentshader

uniform vec2 camera_offset;

uniform sampler2D source;
uniform sampler2D paper;

const vec4 paper_color = vec4(57.0/255.0, 88.0/255.0, 152.0/255.0, 1.0);

void main()
{
	vec4 s = vec4(0);
	s += texture2D(source, gl_TexCoord[0].xy);
	s += texture2D(source, gl_TexCoord[0].xy+vec2(-1.0/800.0, 0.0))*0.1;
	s += texture2D(source, gl_TexCoord[0].xy+vec2( 1.0/800.0, 0.0))*0.1;
	s += texture2D(source, gl_TexCoord[0].xy+vec2(0.0, 1.0/600.0))*0.1;
	s += texture2D(source, gl_TexCoord[0].xy+vec2(0.0, 1.0/600.0))*0.1;
	vec4 p = texture2D(paper, gl_TexCoord[0].xy+camera_offset);
	gl_FragColor = s*pow(p, 2.0)+p*paper_color; // + b * 2;
}
