#include "ntsc-pass2-vertex.inc"
#include "ntsc-decode-filter-2phase.inc"
#include "ntsc-rgbyuv.inc"

#define fetch_offset(offset, one_x) \
   tex2D(s0, vertex.tex + float2((offset) * (one_x), 0.0)).xyz

#pragma parameter NTSC_CRT_GAMMA "NTSC CRT Gamma" 2.4 2.0 3.0 0.02
#ifdef PARAMETER_UNIFORM
uniform float NTSC_CRT_GAMMA;
#else
#define NTSC_CRT_GAMMA 2.4
#endif

float4 main_fragment (uniform input IN, in data vertex, uniform sampler2D s0 : TEXUNIT0) : COLOR
{
#include "ntsc-pass2-decode.inc"
   float3 rgb = yiq2rgb(signal);
   return float4(pow(rgb, NTSC_CRT_GAMMA), 1.0);
}

