void main_vertex
(
	float4 position : POSITION,
	float4 color    : COLOR,
	float2 texCoord : TEXCOORD0,

   uniform float4x4 modelViewProj,

	out float4 oPosition : POSITION,
	out float2 otexCoord : TEXCOORD
)
{
	oPosition = mul(modelViewProj, position);
	otexCoord = texCoord;
}

struct input
{
   float2 video_size;
   float2 texture_size;
   float2 output_size;
   float  frame_count;
   float  frame_direction;
   float  frame_rotation;
};

#include "blur_params.inc"

#define kernel(x) exp(-GLOW_FALLOFF * (x) * (x))

float4 main_fragment(float2 tex : TEXCOORD0, uniform sampler2D s0 : TEXUNIT0, uniform input IN) : COLOR
{
   float3 col = float3(0.0);
   float dy = 1.0 / IN.texture_size.y;

   float k_total = 0.0;
   for (int i = -TAPS; i <= TAPS; i++)
   {
      float k = kernel(i);
      k_total += k;
      col += k * tex2D(s0, tex + float2(0.0, float(i) * dy)).rgb;
   }
   return float4(col / k_total, 1.0);
}

