// 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     float _texel_height;
COMPAT_VARYING     float _cell_height;
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
float _placeholder29;
};
struct prev_0 {
float _placeholder33;
};
struct prev_1 {
float _placeholder37;
};
struct prev_2 {
float _placeholder41;
};
struct prev_3 {
float _placeholder45;
};
struct prev_4 {
float _placeholder49;
};
struct prev_5 {
float _placeholder53;
};
struct prev_6 {
float _placeholder57;
};
struct line_data {
    float _cell_height;
    float _texel_height;
};
vec4 _oPosition1;
float _TMP3;
line_data _oLineData1;
float _TMP2;
input_dummy _IN1;
vec4 _r0011;
float _x0013;
float _x0015;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
 
uniform mat4 MVPMatrix;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec2 _oTexCoord;
    line_data _TMP6;
    vec2 _TMP7;
    _r0011 = VertexCoord.x*MVPMatrix[0];
    _r0011 = _r0011 + VertexCoord.y*MVPMatrix[1];
    _r0011 = _r0011 + VertexCoord.z*MVPMatrix[2];
    _r0011 = _r0011 + VertexCoord.w*MVPMatrix[3];
    _x0013 = OutputSize.y/InputSize.y;
    _TMP2 = floor(_x0013);
    _TMP7 = OutputSize/(InputSize*_TMP2);
    _oPosition1 = _r0011/vec4(_TMP7.x, _TMP7.y, 1.00000000E+00, 1.00000000E+00);
    _oTexCoord = TexCoord.xy + 5.00000000E-01/OutputSize;
    _x0015 = OutputSize.y/InputSize.y;
    _TMP3 = floor(_x0015);
    _TMP6._cell_height = float((1.00000000E+00/TextureSize.y));
    _TMP6._texel_height = float((1.00000000E+00/(TextureSize.y*_TMP3)));
    _oLineData1._cell_height = _TMP6._cell_height;
    _oLineData1._texel_height = _TMP6._texel_height;
    gl_Position = _oPosition1;
    TEX0.xy = _oTexCoord;
    TEX1.x = _TMP6._cell_height;
    TEX2.x = _TMP6._texel_height;
} 
#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     float _texel_height;
COMPAT_VARYING     float _cell_height;
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
float _placeholder39;
};
struct prev_0 {
float _placeholder43;
};
struct prev_1 {
float _placeholder47;
};
struct prev_2 {
float _placeholder51;
};
struct prev_3 {
float _placeholder55;
};
struct prev_4 {
float _placeholder59;
};
struct prev_5 {
float _placeholder63;
};
struct prev_6 {
float _placeholder67;
};
struct line_data {
    float _cell_height;
    float _texel_height;
};
vec4 _ret_0;
float _TMP14;
float _TMP15;
vec4 _TMP12;
vec4 _TMP10;
vec4 _TMP8;
vec4 _TMP6;
vec4 _TMP4;
vec4 _TMP2;
vec4 _TMP1;
vec4 _TMP0;
input_dummy _IN1;
prev_0 _PREV7;
prev_1 _PREV11;
prev_2 _PREV21;
prev_3 _PREV31;
prev_4 _PREV41;
prev_5 _PREV51;
prev_6 _PREV61;
float _y0044;
float _x0046;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
 
uniform sampler2D Texture;
uniform sampler2D Prev6Texture;
uniform sampler2D Prev5Texture;
uniform sampler2D Prev4Texture;
uniform sampler2D Prev3Texture;
uniform sampler2D Prev2Texture;
uniform sampler2D Prev1Texture;
uniform sampler2D PrevTexture;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec3 _input_dummy_rgb;
    vec4 _out_color;
    float _is_on_line;
    vec3 _TMP25;
    _TMP0 = COMPAT_TEXTURE(Texture, TEX0.xy);
    _input_dummy_rgb = vec3(float(_TMP0.x), float(_TMP0.y), float(_TMP0.z));
    _TMP1 = COMPAT_TEXTURE(PrevTexture, TEX0.xy);
    _input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP1.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.33000004E-01).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP1.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.33000004E-01).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP1.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.33000004E-01).z));
    _TMP2 = COMPAT_TEXTURE(Prev1Texture, TEX0.xy);
    _input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP2.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.10889003E-01).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP2.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.10889003E-01).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP2.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.10889003E-01).z));
    _TMP4 = COMPAT_TEXTURE(Prev2Texture, TEX0.xy);
    _input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP4.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.69260386E-02).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP4.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.69260386E-02).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP4.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.69260386E-02).z));
    _TMP6 = COMPAT_TEXTURE(Prev3Texture, TEX0.xy);
    _input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP6.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.22963712E-02).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP6.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.22963712E-02).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP6.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.22963712E-02).z));
    _TMP8 = COMPAT_TEXTURE(Prev4Texture, TEX0.xy);
    _input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP8.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.09469148E-03).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP8.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.09469148E-03).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP8.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.09469148E-03).z));
    _TMP10 = COMPAT_TEXTURE(Prev5Texture, TEX0.xy);
    _input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP10.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.36353227E-03).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP10.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.36353227E-03).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP10.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.36353227E-03).z));
    _TMP12 = COMPAT_TEXTURE(Prev6Texture, TEX0.xy);
    _input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP12.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.54056280E-04).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP12.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.54056280E-04).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP12.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.54056280E-04).z));
    _out_color = vec4(_input_dummy_rgb.x, _input_dummy_rgb.y, _input_dummy_rgb.z, 1.00000000E+00);
    _y0044 = float(TEX1.x);
    _x0046 = TEX0.y/_y0044;
    _TMP15 = floor(_x0046);
    _TMP14 = TEX0.y - _y0044*_TMP15;
    _is_on_line = float(int((_TMP14 > float(TEX2.x))));
    _TMP25 = _out_color.xyz*_is_on_line;
    _out_color = vec4(_TMP25.x, _TMP25.y, _TMP25.z, _out_color.w - 5.00000000E-01*float(!bool(_is_on_line)));
    _ret_0 = vec4(float(_out_color.x), float(_out_color.y), float(_out_color.z), float(_out_color.w));
    FragColor = _ret_0;
    return;
} 
#endif
