// GLSL shader autogenerated by cg2glsl.py.
#if defined(VERTEX)

#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
#define COMPAT_ATTRIBUTE attribute
#define COMPAT_TEXTURE texture2D
#endif

#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_VARYING     vec4 _col;
COMPAT_VARYING     vec2 VARprev6;
COMPAT_VARYING     vec2 VARprev5;
COMPAT_VARYING     vec2 VARprev4;
COMPAT_VARYING     vec2 VARprev3;
COMPAT_VARYING     vec2 VARprev2;
COMPAT_VARYING     vec2 VARprev1;
COMPAT_VARYING     vec2 VARprev;
COMPAT_VARYING     vec2 VARtex;
COMPAT_VARYING     vec2 _tex_coord;
COMPAT_VARYING     float _frame_rotation;
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
struct previous {
float _placeholder72;
    vec2 _tex_coord;
};
struct tex_coords {
    vec2 VARtex;
    vec2 VARprev;
    vec2 VARprev1;
    vec2 VARprev2;
    vec2 VARprev3;
    vec2 VARprev4;
    vec2 VARprev5;
    vec2 VARprev6;
};
struct output_dummy {
    vec4 _col;
};
vec4 _oPosition1;
tex_coords _coords1;
previous _PREV7;
previous _PREV11;
previous _PREV21;
previous _PREV31;
previous _PREV41;
previous _PREV51;
previous _PREV61;
vec4 _r0014;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
 
uniform mat4 MVPMatrix;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
COMPAT_ATTRIBUTE vec2 Prev6TexCoord;
COMPAT_ATTRIBUTE vec2 Prev5TexCoord;
COMPAT_ATTRIBUTE vec2 Prev4TexCoord;
COMPAT_ATTRIBUTE vec2 Prev3TexCoord;
COMPAT_ATTRIBUTE vec2 Prev2TexCoord;
COMPAT_ATTRIBUTE vec2 Prev1TexCoord;
COMPAT_ATTRIBUTE vec2 PrevTexCoord;
void main()
{
    _r0014 = VertexCoord.x*MVPMatrix[0];
    _r0014 = _r0014 + VertexCoord.y*MVPMatrix[1];
    _r0014 = _r0014 + VertexCoord.z*MVPMatrix[2];
    _r0014 = _r0014 + VertexCoord.w*MVPMatrix[3];
    _oPosition1 = _r0014;
    VARtex = TexCoord.xy;
    VARprev = PrevTexCoord;
    VARprev1 = Prev1TexCoord;
    VARprev2 = Prev2TexCoord;
    VARprev3 = Prev3TexCoord;
    VARprev4 = Prev4TexCoord;
    VARprev5 = Prev5TexCoord;
    VARprev6 = Prev6TexCoord;
    gl_Position = _r0014;
} 
#elif defined(FRAGMENT)

#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out vec4 FragColor;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#endif

#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_VARYING     vec4 _col;
COMPAT_VARYING     vec2 _prev61;
COMPAT_VARYING     vec2 _prev51;
COMPAT_VARYING     vec2 _prev41;
COMPAT_VARYING     vec2 _prev31;
COMPAT_VARYING     vec2 _prev21;
COMPAT_VARYING     vec2 _prev11;
COMPAT_VARYING     vec2 _prev;
COMPAT_VARYING     vec2 _tex;
COMPAT_VARYING     vec2 _tex_coord;
COMPAT_VARYING     float _frame_rotation;
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
struct previous {
float _placeholder65;
    vec2 _tex_coord;
};
struct tex_coords {
    vec2 _tex;
    vec2 _prev;
    vec2 _prev11;
    vec2 _prev21;
    vec2 _prev31;
    vec2 _prev41;
    vec2 _prev51;
    vec2 _prev61;
};
struct output_dummy {
    vec4 _col;
};
vec4 _TMP7;
vec4 _TMP6;
vec4 _TMP5;
vec4 _TMP4;
vec4 _TMP3;
vec4 _TMP2;
vec4 _TMP1;
vec4 _TMP0;
previous _PREV7;
previous _PREV11;
previous _PREV21;
previous _PREV31;
previous _PREV41;
previous _PREV51;
previous _PREV61;
uniform sampler2D Texture;
vec3 _r0052;
vec3 _r0054;
vec3 _r0056;
vec3 _r0058;
vec3 _r0060;
vec3 _r0062;
vec3 _r0064;
COMPAT_VARYING vec4 TEX0;
uniform vec3 _RGB_to_YIQ[3];
 
uniform sampler2D Prev6Texture;
uniform sampler2D Prev5Texture;
uniform sampler2D Prev4Texture;
uniform sampler2D Prev3Texture;
uniform sampler2D Prev2Texture;
uniform sampler2D Prev1Texture;
uniform sampler2D PrevTexture;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec3 _input_dummy;
    vec4 _luma_trails;
    vec4 _screen;
    output_dummy _OUT;
    _TMP0 = COMPAT_TEXTURE(Texture, TEX0.xy);
    _TMP1 = COMPAT_TEXTURE(PrevTexture, TEX0.xy);
    _TMP2 = COMPAT_TEXTURE(Prev1Texture, TEX0.xy);
    _TMP3 = COMPAT_TEXTURE(Prev2Texture, TEX0.xy);
    _TMP4 = COMPAT_TEXTURE(Prev3Texture, TEX0.xy);
    _TMP5 = COMPAT_TEXTURE(Prev4Texture, TEX0.xy);
    _TMP6 = COMPAT_TEXTURE(Prev5Texture, TEX0.xy);
    _TMP7 = COMPAT_TEXTURE(Prev6Texture, TEX0.xy);
    _r0052 = _TMP1.x*_RGB_to_YIQ[0];
    _r0052 = _r0052 + _TMP1.y*_RGB_to_YIQ[1];
    _r0052 = _r0052 + _TMP1.z*_RGB_to_YIQ[2];
    _r0054 = _TMP2.x*_RGB_to_YIQ[0];
    _r0054 = _r0054 + _TMP2.y*_RGB_to_YIQ[1];
    _r0054 = _r0054 + _TMP2.z*_RGB_to_YIQ[2];
    _r0056 = _TMP3.x*_RGB_to_YIQ[0];
    _r0056 = _r0056 + _TMP3.y*_RGB_to_YIQ[1];
    _r0056 = _r0056 + _TMP3.z*_RGB_to_YIQ[2];
    _r0058 = _TMP4.x*_RGB_to_YIQ[0];
    _r0058 = _r0058 + _TMP4.y*_RGB_to_YIQ[1];
    _r0058 = _r0058 + _TMP4.z*_RGB_to_YIQ[2];
    _r0060 = _TMP5.x*_RGB_to_YIQ[0];
    _r0060 = _r0060 + _TMP5.y*_RGB_to_YIQ[1];
    _r0060 = _r0060 + _TMP5.z*_RGB_to_YIQ[2];
    _r0062 = _TMP6.x*_RGB_to_YIQ[0];
    _r0062 = _r0062 + _TMP6.y*_RGB_to_YIQ[1];
    _r0062 = _r0062 + _TMP6.z*_RGB_to_YIQ[2];
    _r0064 = _TMP7.x*_RGB_to_YIQ[0];
    _r0064 = _r0064 + _TMP7.y*_RGB_to_YIQ[1];
    _r0064 = _r0064 + _TMP7.z*_RGB_to_YIQ[2];
    _input_dummy = _r0052.xxx*1.60000011E-01;
    _input_dummy = _input_dummy + _r0054.xxx*6.40000030E-02;
    _input_dummy = _input_dummy + _r0056.xxx*2.56000012E-02;
    _input_dummy = _input_dummy + _r0058.xxx*1.02400007E-02;
    _input_dummy = _input_dummy + _r0060.xxx*4.09600046E-03;
    _input_dummy = _input_dummy + _r0062.xxx*1.63840014E-03;
    _input_dummy = _input_dummy + _r0064.xxx*6.55360054E-04;
    _luma_trails = vec4(_input_dummy.x, _input_dummy.y, _input_dummy.z, 1.00000000E+00);
    if (_TMP0.x + _TMP0.y + _TMP0.z > 1.00000001E-01) { 
        _screen = vec4(_TMP0.x, _TMP0.y, _TMP0.z, 0.00000000E+00);
    } else {
        _screen = vec4(_TMP0.x, _TMP0.y, _TMP0.z, 1.00000000E+00);
    } 
    _OUT._col = _screen + _screen.w*(_luma_trails - _screen);
    FragColor = _OUT._col;
    return;
} 
#endif
