// 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 _t6;
COMPAT_VARYING     vec4 _t5;
COMPAT_VARYING     vec4 _t4;
COMPAT_VARYING     vec4 _t3;
COMPAT_VARYING     vec4 _t2;
COMPAT_VARYING     vec4 _t1;
COMPAT_VARYING     vec4 _texCoord;
COMPAT_VARYING     vec4 _position1;
struct out_vertex {
    vec4 _position1;
    vec4 _texCoord;
    vec4 _t1;
    vec4 _t2;
    vec4 _t3;
    vec4 _t4;
    vec4 _t5;
    vec4 _t6;
};
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
out_vertex _ret_0;
vec4 _r0033;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
COMPAT_VARYING vec4 TEX3;
COMPAT_VARYING vec4 TEX4;
COMPAT_VARYING vec4 TEX5;
COMPAT_VARYING vec4 TEX6;
 
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 _TMP29;
    _r0033 = VertexCoord.x*MVPMatrix[0];
    _r0033 = _r0033 + VertexCoord.y*MVPMatrix[1];
    _r0033 = _r0033 + VertexCoord.z*MVPMatrix[2];
    _r0033 = _r0033 + VertexCoord.w*MVPMatrix[3];
    _TMP29._texCoord = vec4(TexCoord.x, TexCoord.y, 0.00000000E+00, 0.00000000E+00);
    _TMP29._t1 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4( -8.15529958E-04, -1.01451250E-03, -2.10035988E-03, -1.83949989E-04);
    _TMP29._t2 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4( -1.73978484E-03, 1.14284246E-03, -5.08362486E-04, 1.55178993E-03);
    _TMP29._t3 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4( 2.40584998E-03, -4.87457495E-04, 1.18358503E-03, -1.20006502E-03);
    _TMP29._t4 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4( 1.29864004E-03, 1.91755500E-03, 4.63652483E-04, -2.23281002E-03);
    _TMP29._t5 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4( 1.26857741E-03, 1.61062489E-04, 2.24104989E-03, 1.03114499E-03);
    _TMP29._t6 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4( -8.04850017E-04, -2.33153743E-03, -1.97889749E-03, -1.49426248E-03);
    _ret_0._position1 = _r0033;
    _ret_0._texCoord = _TMP29._texCoord;
    _ret_0._t1 = _TMP29._t1;
    _ret_0._t2 = _TMP29._t2;
    _ret_0._t3 = _TMP29._t3;
    _ret_0._t4 = _TMP29._t4;
    _ret_0._t5 = _TMP29._t5;
    _ret_0._t6 = _TMP29._t6;
    gl_Position = _r0033;
    TEX0 = _TMP29._texCoord;
    TEX1 = _TMP29._t1;
    TEX2 = _TMP29._t2;
    TEX3 = _TMP29._t3;
    TEX4 = _TMP29._t4;
    TEX5 = _TMP29._t5;
    TEX6 = _TMP29._t6;
    return;
    TEX0 = _ret_0._texCoord;
    TEX1 = _ret_0._t1;
    TEX2 = _ret_0._t2;
    TEX3 = _ret_0._t3;
    TEX4 = _ret_0._t4;
    TEX5 = _ret_0._t5;
    TEX6 = _ret_0._t6;
} 
#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 _t6;
COMPAT_VARYING     vec4 _t5;
COMPAT_VARYING     vec4 _t4;
COMPAT_VARYING     vec4 _t3;
COMPAT_VARYING     vec4 _t2;
COMPAT_VARYING     vec4 _t1;
COMPAT_VARYING     vec4 _texCoord;
struct out_vertex {
    vec4 _texCoord;
    vec4 _t1;
    vec4 _t2;
    vec4 _t3;
    vec4 _t4;
    vec4 _t5;
    vec4 _t6;
};
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
vec4 _ret_0;
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;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
COMPAT_VARYING vec4 TEX3;
COMPAT_VARYING vec4 TEX4;
COMPAT_VARYING vec4 TEX5;
COMPAT_VARYING vec4 TEX6;
 
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec4 _color;
    _color = COMPAT_TEXTURE(Texture, TEX0.xy);
    _TMP0 = COMPAT_TEXTURE(Texture, TEX1.xy);
    _color = _color + _TMP0;
    _TMP1 = COMPAT_TEXTURE(Texture, TEX1.zw);
    _color = _color + _TMP1;
    _TMP2 = COMPAT_TEXTURE(Texture, TEX2.xy);
    _color = _color + _TMP2;
    _TMP3 = COMPAT_TEXTURE(Texture, TEX2.zw);
    _color = _color + _TMP3;
    _TMP4 = COMPAT_TEXTURE(Texture, TEX3.xy);
    _color = _color + _TMP4;
    _TMP5 = COMPAT_TEXTURE(Texture, TEX3.zw);
    _color = _color + _TMP5;
    _TMP6 = COMPAT_TEXTURE(Texture, TEX4.xy);
    _color = _color + _TMP6;
    _TMP7 = COMPAT_TEXTURE(Texture, TEX4.zw);
    _color = _color + _TMP7;
    _TMP8 = COMPAT_TEXTURE(Texture, TEX5.xy);
    _color = _color + _TMP8;
    _TMP9 = COMPAT_TEXTURE(Texture, TEX5.zw);
    _color = _color + _TMP9;
    _TMP10 = COMPAT_TEXTURE(Texture, TEX6.xy);
    _color = _color + _TMP10;
    _TMP11 = COMPAT_TEXTURE(Texture, TEX6.zw);
    _color = _color + _TMP11;
    _ret_0 = _color/1.30000000E+01;
    FragColor = _ret_0;
    return;
} 
#endif
