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 dx = 4.0 / IN.texture_size.x; // Mipmapped

   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(float(i) * dx, 0.0)).rgb;
   }
   return float4(col / k_total, 1.0);
}

