//
// Bloom vertex shader (blurH)
// RvG, 10-3-09
//

struct v2f
{
  float2 tc0        : TEXCOORD0;
};

struct FragOut
{
	float4 col : COLOR;
};

FragOut main(
  v2f IN,
  uniform sampler2D tex : TEXUNIT0,
  uniform float    texelSize,
  uniform float4x4 modelViewProj
)
{
  FragOut OUT;
  float2 uv=IN.tc0;
  
/*
  // Single sample
  float accum=tex2D(tex,uv);
  OUT.col=accum;
*/

  // Multiple samples (2x2)
  float4 accum=0;
  
  accum+=tex2D(tex,uv+texelSize*float2(-0.5,-0.5));
  accum+=tex2D(tex,uv+texelSize*float2(-0.5,0.5));
  accum+=tex2D(tex,uv+texelSize*float2(0.5,0.5));
  accum+=tex2D(tex,uv+texelSize*float2(0.5,-0.5));
  
  OUT.col=accum*0.25;
  
//OUT.col=tex2D(tex,uv);
  
  return OUT;
}
