// 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 _t3;
COMPAT_VARYING     vec4 _t2;
COMPAT_VARYING     vec4 _t1;
COMPAT_VARYING     vec2 _texCoord1;
COMPAT_VARYING     vec4 _color1;
COMPAT_VARYING     vec4 _position1;
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 out_vertex {
    vec4 _position1;
    vec4 _color1;
    vec2 _texCoord1;
    vec4 _t1;
    vec4 _t2;
    vec4 _t3;
};
out_vertex _ret_0;
input_dummy _IN1;
vec4 _r0006;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 COLOR;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 COL0;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
COMPAT_VARYING vec4 TEX3;
 
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()
{
    out_vertex _OUT;
    float _dy;
    _r0006 = VertexCoord.x*MVPMatrix[0];
    _r0006 = _r0006 + VertexCoord.y*MVPMatrix[1];
    _r0006 = _r0006 + VertexCoord.z*MVPMatrix[2];
    _r0006 = _r0006 + VertexCoord.w*MVPMatrix[3];
    _dy = 1.00000000E+00/TextureSize.y;
    _OUT._t1 = TexCoord.xyyy + vec4(0.00000000E+00, -4.00000000E+00*_dy, -3.00000000E+00*_dy, -2.00000000E+00*_dy);
    _OUT._t2 = TexCoord.xyyy + vec4(0.00000000E+00, -_dy, 0.00000000E+00, _dy);
    _OUT._t3 = TexCoord.xyyy + vec4(0.00000000E+00, 2.00000000E+00*_dy, 3.00000000E+00*_dy, 4.00000000E+00*_dy);
    _ret_0._position1 = _r0006;
    _ret_0._color1 = COLOR;
    _ret_0._texCoord1 = TexCoord.xy;
    _ret_0._t1 = _OUT._t1;
    _ret_0._t2 = _OUT._t2;
    _ret_0._t3 = _OUT._t3;
    gl_Position = _r0006;
    COL0 = COLOR;
    TEX0.xy = TexCoord.xy;
    TEX1 = _OUT._t1;
    TEX2 = _OUT._t2;
    TEX3 = _OUT._t3;
    return;
    COL0 = _ret_0._color1;
    TEX0.xy = _ret_0._texCoord1;
    TEX1 = _ret_0._t1;
    TEX2 = _ret_0._t2;
    TEX3 = _ret_0._t3;
} 
#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 _t3;
COMPAT_VARYING     vec4 _t2;
COMPAT_VARYING     vec4 _t1;
COMPAT_VARYING     vec2 _texCoord;
COMPAT_VARYING     vec4 _color;
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 out_vertex {
    vec4 _color;
    vec2 _texCoord;
    vec4 _t1;
    vec4 _t2;
    vec4 _t3;
};
vec4 _ret_0;
float _TMP21;
float _TMP20;
float _TMP19;
float _TMP18;
vec4 _TMP17;
vec4 _TMP16;
vec4 _TMP15;
vec4 _TMP14;
vec4 _TMP13;
vec4 _TMP12;
vec4 _TMP11;
vec4 _TMP10;
vec4 _TMP9;
vec4 _TMP8;
vec4 _TMP7;
vec4 _TMP6;
vec4 _TMP5;
vec4 _TMP4;
vec4 _TMP3;
vec4 _TMP2;
vec4 _TMP1;
vec4 _TMP0;
uniform sampler2D Texture;
float _TMP25;
float _TMP29;
float _TMP33;
float _TMP37;
vec4 _a0150;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
COMPAT_VARYING vec4 TEX3;
 
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    float _norm;
    vec4 _sum;
    _TMP25 = pow(2.71828198E+00, -2.50000000E-01);
    _TMP29 = pow(2.71828198E+00, -1.00000000E+00);
    _TMP33 = pow(2.71828198E+00, -2.25000000E+00);
    _TMP37 = pow(2.71828198E+00, -4.00000000E+00);
    _norm = 1.00000000E+00/(1.00000000E+00 + 2.00000000E+00*(_TMP25 + _TMP29 + _TMP33 + _TMP37));
    _TMP0 = COMPAT_TEXTURE(Texture, TEX1.xy);
    _TMP18 = pow(_TMP0.x, 2.50000000E+00);
    _TMP19 = pow(_TMP0.y, 2.50000000E+00);
    _TMP20 = pow(_TMP0.z, 2.50000000E+00);
    _TMP21 = pow(_TMP0.w, 2.50000000E+00);
    _TMP1 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _TMP1*vec4(_TMP37, _TMP37, _TMP37, _TMP37);
    _TMP2 = COMPAT_TEXTURE(Texture, TEX1.xz);
    _TMP18 = pow(_TMP2.x, 2.50000000E+00);
    _TMP19 = pow(_TMP2.y, 2.50000000E+00);
    _TMP20 = pow(_TMP2.z, 2.50000000E+00);
    _TMP21 = pow(_TMP2.w, 2.50000000E+00);
    _TMP3 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP3*vec4(_TMP33, _TMP33, _TMP33, _TMP33);
    _TMP4 = COMPAT_TEXTURE(Texture, TEX1.xw);
    _TMP18 = pow(_TMP4.x, 2.50000000E+00);
    _TMP19 = pow(_TMP4.y, 2.50000000E+00);
    _TMP20 = pow(_TMP4.z, 2.50000000E+00);
    _TMP21 = pow(_TMP4.w, 2.50000000E+00);
    _TMP5 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP5*vec4(_TMP29, _TMP29, _TMP29, _TMP29);
    _TMP6 = COMPAT_TEXTURE(Texture, TEX2.xy);
    _TMP18 = pow(_TMP6.x, 2.50000000E+00);
    _TMP19 = pow(_TMP6.y, 2.50000000E+00);
    _TMP20 = pow(_TMP6.z, 2.50000000E+00);
    _TMP21 = pow(_TMP6.w, 2.50000000E+00);
    _TMP7 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP7*vec4(_TMP25, _TMP25, _TMP25, _TMP25);
    _TMP8 = COMPAT_TEXTURE(Texture, TEX0.xy);
    _TMP18 = pow(_TMP8.x, 2.50000000E+00);
    _TMP19 = pow(_TMP8.y, 2.50000000E+00);
    _TMP20 = pow(_TMP8.z, 2.50000000E+00);
    _TMP21 = pow(_TMP8.w, 2.50000000E+00);
    _TMP9 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP9;
    _TMP10 = COMPAT_TEXTURE(Texture, TEX2.xw);
    _TMP18 = pow(_TMP10.x, 2.50000000E+00);
    _TMP19 = pow(_TMP10.y, 2.50000000E+00);
    _TMP20 = pow(_TMP10.z, 2.50000000E+00);
    _TMP21 = pow(_TMP10.w, 2.50000000E+00);
    _TMP11 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP11*vec4(_TMP25, _TMP25, _TMP25, _TMP25);
    _TMP12 = COMPAT_TEXTURE(Texture, TEX3.xy);
    _TMP18 = pow(_TMP12.x, 2.50000000E+00);
    _TMP19 = pow(_TMP12.y, 2.50000000E+00);
    _TMP20 = pow(_TMP12.z, 2.50000000E+00);
    _TMP21 = pow(_TMP12.w, 2.50000000E+00);
    _TMP13 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP13*vec4(_TMP29, _TMP29, _TMP29, _TMP29);
    _TMP14 = COMPAT_TEXTURE(Texture, TEX3.xz);
    _TMP18 = pow(_TMP14.x, 2.50000000E+00);
    _TMP19 = pow(_TMP14.y, 2.50000000E+00);
    _TMP20 = pow(_TMP14.z, 2.50000000E+00);
    _TMP21 = pow(_TMP14.w, 2.50000000E+00);
    _TMP15 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP15*vec4(_TMP33, _TMP33, _TMP33, _TMP33);
    _TMP16 = COMPAT_TEXTURE(Texture, TEX3.xw);
    _TMP18 = pow(_TMP16.x, 2.50000000E+00);
    _TMP19 = pow(_TMP16.y, 2.50000000E+00);
    _TMP20 = pow(_TMP16.z, 2.50000000E+00);
    _TMP21 = pow(_TMP16.w, 2.50000000E+00);
    _TMP17 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    _sum = _sum + _TMP17*vec4(_TMP37, _TMP37, _TMP37, _TMP37);
    _a0150 = _sum*vec4(_norm, _norm, _norm, _norm);
    _TMP18 = pow(_a0150.x, 4.54545438E-01);
    _TMP19 = pow(_a0150.y, 4.54545438E-01);
    _TMP20 = pow(_a0150.z, 4.54545438E-01);
    _TMP21 = pow(_a0150.w, 4.54545438E-01);
    _ret_0 = vec4(_TMP18, _TMP19, _TMP20, _TMP21);
    FragColor = _ret_0;
    return;
} 
#endif
