#vertexshader

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

#fragmentshader

uniform float bloom_amount;

uniform sampler2D color_texture;
uniform sampler2D bloom_texture;
uniform sampler2D dof_texture;

void main(void)
{
	vec4 color_sample = texture2D(color_texture, gl_TexCoord[0].xy);
	vec4 color = vec4(color_sample.rgb, 1.0);
	float bluriness = color_sample.a;
	
	vec4 dof = texture2D(dof_texture, gl_TexCoord[0].xy);
	vec4 bloom = texture2D(bloom_texture, gl_TexCoord[0].xy);
	
	
	gl_FragColor = vec4(mix(color.rgb, dof.rgb, bluriness), 1.0) + bloom*bloom_amount;
}

