// 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 _frame_rotation;
COMPAT_VARYING     vec4 _color1;
struct output_dummy {
    vec4 _color1;
};
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
vec4 _oPosition1;
vec4 _r0006;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 COLOR;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 COL0;
COMPAT_VARYING vec4 TEX0;
 
uniform mat4 MVPMatrix;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec4 _oColor;
    vec2 _otexCoord;
    _r0006 = VertexCoord.x*MVPMatrix[0];
    _r0006 = _r0006 + VertexCoord.y*MVPMatrix[1];
    _r0006 = _r0006 + VertexCoord.z*MVPMatrix[2];
    _r0006 = _r0006 + VertexCoord.w*MVPMatrix[3];
    _oPosition1 = _r0006;
    _oColor = COLOR;
    _otexCoord = TexCoord.xy;
    gl_Position = _r0006;
    COL0 = COLOR;
    TEX0.xy = TexCoord.xy;
} 
#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 _frame_rotation;
COMPAT_VARYING     vec4 _color1;
struct output_dummy {
    vec4 _color1;
};
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
vec4 _TMP1;
float _TMP12;
vec4 _TMP11;
vec4 _TMP10;
float _TMP9;
float _TMP8;
float _TMP7;
float _TMP6;
float _TMP5;
float _TMP4;
float _TMP3;
float _TMP2;
input_dummy _IN1;
vec4 _g000017;
vec4 _g010017;
vec4 _g020017;
vec4 _g100017;
vec4 _g120017;
vec4 _g200017;
vec4 _g210017;
vec4 _g220017;
vec4 _Gx0017;
vec4 _Gy0017;
vec4 _color0017;
vec2 _c0019;
vec2 _c0021;
vec2 _c0023;
vec2 _c0025;
vec2 _c0027;
vec2 _c0029;
vec2 _c0031;
vec2 _c0033;
float _x0055;
float _TMP56;
vec2 _c0063;
COMPAT_VARYING vec4 TEX0;
sampler2D _TMP66;
uniform sampler2D Texture;
sampler2D _TMP68;
sampler2D _TMP69;
sampler2D _TMP70;
sampler2D _TMP71;
sampler2D _TMP72;
sampler2D _TMP73;
sampler2D _TMP74;
 
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec4 _outcolor;
    vec2 _texelSize;
    vec2 _offset;
    vec4 _sum;
    vec4 _pixelColor;
    output_dummy _OUT;
    _texelSize = 1.00000000E+00/TextureSize;
    _offset = vec2(_texelSize.x, _texelSize.y);
    _TMP66 = sampler2D(sampler(Texture));
    _c0019 = TEX0.xy + vec2(-_offset.x, -_offset.y);
    _g000017 = COMPAT_TEXTURE(_TMP66, _c0019);
    _TMP68 = sampler2D(sampler(Texture));
    _c0021 = TEX0.xy + vec2(0.00000000E+00, -_offset.y);
    _g010017 = COMPAT_TEXTURE(_TMP68, _c0021);
    _TMP69 = sampler2D(sampler(Texture));
    _c0023 = TEX0.xy + vec2(_offset.x, -_offset.y);
    _g020017 = COMPAT_TEXTURE(_TMP69, _c0023);
    _TMP70 = sampler2D(sampler(Texture));
    _c0025 = TEX0.xy + vec2(-_offset.x, 0.00000000E+00);
    _g100017 = COMPAT_TEXTURE(_TMP70, _c0025);
    _TMP71 = sampler2D(sampler(Texture));
    _c0027 = TEX0.xy + vec2(_offset.x, 0.00000000E+00);
    _g120017 = COMPAT_TEXTURE(_TMP71, _c0027);
    _TMP72 = sampler2D(sampler(Texture));
    _c0029 = TEX0.xy + vec2(-_offset.x, _offset.y);
    _g200017 = COMPAT_TEXTURE(_TMP72, _c0029);
    _TMP73 = sampler2D(sampler(Texture));
    _c0031 = TEX0.xy + vec2(0.00000000E+00, _offset.y);
    _g210017 = COMPAT_TEXTURE(_TMP73, _c0031);
    _TMP74 = sampler2D(sampler(Texture));
    _c0033 = TEX0.xy + vec2(_offset.x, _offset.y);
    _g220017 = COMPAT_TEXTURE(_TMP74, _c0033);
    _TMP2 = dot(_g000017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _TMP3 = dot(_g010017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _TMP4 = dot(_g020017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _TMP5 = dot(_g100017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _TMP6 = dot(_g120017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _TMP7 = dot(_g200017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _TMP8 = dot(_g210017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _TMP9 = dot(_g220017.xyz, vec3( 3.00000012E-01, 5.89999974E-01, 1.09999999E-01));
    _Gx0017 = -(vec4(_TMP2, _TMP2, _TMP2, _TMP2) + 2.00000000E+00*vec4(_TMP5, _TMP5, _TMP5, _TMP5) + vec4(_TMP7, _TMP7, _TMP7, _TMP7)) + vec4(_TMP4, _TMP4, _TMP4, _TMP4) + 2.00000000E+00*vec4(_TMP6, _TMP6, _TMP6, _TMP6) + vec4(_TMP9, _TMP9, _TMP9, _TMP9);
    _Gy0017 = -(vec4(_TMP2, _TMP2, _TMP2, _TMP2) + 2.00000000E+00*vec4(_TMP3, _TMP3, _TMP3, _TMP3) + vec4(_TMP4, _TMP4, _TMP4, _TMP4)) + vec4(_TMP7, _TMP7, _TMP7, _TMP7) + 2.00000000E+00*vec4(_TMP8, _TMP8, _TMP8, _TMP8) + vec4(_TMP9, _TMP9, _TMP9, _TMP9);
    _TMP10 = abs(_Gx0017);
    _TMP11 = abs(_Gy0017);
    _color0017 = _TMP10 + _TMP11;
    _x0055 = _color0017.x*2.00000003E-01;
    _TMP12 = min(1.00000000E+00, _x0055);
    _TMP56 = max(0.00000000E+00, _TMP12);
    _c0063 = TEX0.xy + -6.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _TMP1*2.21600011E-03;
    _c0063 = TEX0.xy + -5.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*8.76399968E-03;
    _c0063 = TEX0.xy + -4.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*2.69949995E-02;
    _c0063 = TEX0.xy + -3.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*6.47590011E-02;
    _c0063 = TEX0.xy + -2.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*1.20985001E-01;
    _c0063 = TEX0.xy + -_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*1.76033005E-01;
    _TMP1 = COMPAT_TEXTURE(Texture, TEX0.xy);
    _sum = _sum + _TMP1*1.99470997E-01;
    _c0063 = TEX0.xy + _offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*1.76033005E-01;
    _c0063 = TEX0.xy + 2.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*1.20985001E-01;
    _c0063 = TEX0.xy + 3.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*6.47590011E-02;
    _c0063 = TEX0.xy + 4.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*2.69949995E-02;
    _c0063 = TEX0.xy + 5.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*8.76399968E-03;
    _c0063 = TEX0.xy + 6.00000000E+00*_offset.xy;
    _TMP1 = COMPAT_TEXTURE(Texture, _c0063);
    _sum = _sum + _TMP1*2.21600011E-03;
    _pixelColor = COMPAT_TEXTURE(Texture, TEX0.xy);
    _outcolor = (-_TMP56 + (_TMP56*_pixelColor)*2.00000000E+00) + _sum;
    _OUT._color1.xyz = _outcolor.xyz;
    FragColor = _OUT._color1;
    return;
} 
#endif
