// 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 _color1;
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 output_dummy {
    vec4 _color1;
};
vec4 _oPosition1;
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;
 
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;
    vec2 _shift;
    _shift = (5.00000000E-01*InputSize)/TextureSize;
    _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 - _shift)*7.50000000E-01 + _shift)*vec2( 3.04999995E+00, 2.00000000E+00) - vec2( 6.39999986E-01, 0.00000000E+00);
    gl_Position = _r0006;
    COL0 = COLOR;
    TEX0.xy = _otexCoord;
} 
#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 _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 output_dummy {
    vec4 _color;
};
vec2 _TMP1;
vec2 _TMP0;
uniform sampler2D Texture;
input_dummy _IN1;
vec2 _pos0005;
vec2 _pos0007;
COMPAT_VARYING vec4 TEX0;
 
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec2 _warpCoord1;
    vec2 _warpCoord2;
    vec2 _fragCoord1;
    vec2 _fragCoord2;
    vec4 _frame1;
    vec4 _frame2;
    vec4 _final;
    _pos0005 = (TEX0.xy - vec2( 3.49999994E-01, 3.00000012E-01))*(TextureSize.xy/InputSize.xy);
    _pos0005 = _pos0005*2.00000000E+00 - 1.00000000E+00;
    _pos0005 = _pos0005*vec2(1.00000000E+00 + _pos0005.y*_pos0005.y*3.00000012E-01, 1.00000000E+00 + _pos0005.x*_pos0005.x*3.00000012E-01);
    _TMP0 = _pos0005*5.00000000E-01 + 5.00000000E-01;
    _warpCoord1 = _TMP0*(InputSize.xy/TextureSize.xy);
    _pos0007 = (TEX0.xy + vec2( 3.49999994E-01, -3.00000012E-01))*(TextureSize.xy/InputSize.xy);
    _pos0007 = _pos0007*2.00000000E+00 - 1.00000000E+00;
    _pos0007 = _pos0007*vec2(1.00000000E+00 + _pos0007.y*_pos0007.y*3.00000012E-01, 1.00000000E+00 + _pos0007.x*_pos0007.x*3.00000012E-01);
    _TMP1 = _pos0007*5.00000000E-01 + 5.00000000E-01;
    _warpCoord2 = _TMP1*(InputSize.xy/TextureSize.xy);
    _fragCoord1 = (_warpCoord1*InputSize)/TextureSize;
    _fragCoord2 = (_warpCoord2*InputSize)/TextureSize;
    _frame1 = vec4( 0.00000000E+00, 0.00000000E+00, 0.00000000E+00, 0.00000000E+00);
    if (_fragCoord1.x < 1.00000000E+00 && _fragCoord1.x > 0.00000000E+00 && _fragCoord1.y < 1.00000000E+00 && _fragCoord1.y > 0.00000000E+00) { 
        _frame1 = COMPAT_TEXTURE(Texture, _warpCoord1);
    } 
    _frame2 = vec4( 0.00000000E+00, 0.00000000E+00, 0.00000000E+00, 0.00000000E+00);
    if (_fragCoord2.x < 1.00000000E+00 && _fragCoord2.x > 0.00000000E+00 && _fragCoord2.y < 1.00000000E+00 && _fragCoord2.y > 0.00000000E+00) { 
        _frame2 = COMPAT_TEXTURE(Texture, _warpCoord2);
    } 
    _final = vec4(_frame1.x + _frame2.y, 0.00000000E+00, 0.00000000E+00, 1.00000000E+00);
    FragColor = _final;
    return;
} 
#endif
