struct input
{
   float2 video_size;
   float2 texture_size;
};

void main_vertex
(
   float4 position : POSITION,
   out float4 oPosition : POSITION,
   uniform float4x4 modelViewProj,
   float2 tex : TEXCOORD,
   out float2 oTex : TEXCOORD
)
{
   oPosition = mul(modelViewProj, position);
   oTex = tex;
}

float4 main_fragment (float2 tex : TEXCOORD, uniform sampler2D s0 : TEXUNIT0, uniform input IN) : COLOR
{
   half2 ps = 1.0 / IN.texture_size;
   float4 l = tex2D(s0, float2(tex.x - ps.x, tex.y));
   float4 r = tex2D(s0, tex);
   return IN.video_size.x > 256 ? lerp(l,r,0.5) : r;
}
