// 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 VARt6;

COMPAT_VARYING     vec4 VARt5;

COMPAT_VARYING     vec4 VARt4;

COMPAT_VARYING     vec4 VARt3;

COMPAT_VARYING     vec4 VARt2;

COMPAT_VARYING     vec4 VARt1;





struct tex_coords {

    vec4 VARt1;

    vec4 VARt2;

    vec4 VARt3;

    vec4 VARt4;

    vec4 VARt5;

    vec4 VARt6;

};



struct input_dummy {

    vec2 _video_size;

    vec2 _texture_size;

    vec2 _output_dummy_size;

};



vec4 _oPosition1;

tex_coords _coords1;



input_dummy _IN1;

vec4 _r0019;

COMPAT_ATTRIBUTE vec4 VertexCoord;

COMPAT_ATTRIBUTE vec4 COLOR;

COMPAT_VARYING vec4 COL0;

COMPAT_ATTRIBUTE vec4 TexCoord;

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 _oTex;

    vec2 _ps;

    float _sx;

    float _sy;

    tex_coords _TMP15;



    _r0019 = VertexCoord.x*MVPMatrix[0];

    _r0019 = _r0019 + VertexCoord.y*MVPMatrix[1];

    _r0019 = _r0019 + VertexCoord.z*MVPMatrix[2];

    _r0019 = _r0019 + VertexCoord.w*MVPMatrix[3];

    _oPosition1 = _r0019;

    _oColor = COLOR;

    _oTex = TexCoord.xy;

    _ps = 5.00000000E-001/TextureSize;

    _sx = _ps.x*5.00000000E-001;

    _sy = _ps.y*5.00000000E-001;

    _TMP15.VARt1 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4(-_ps.x, -_ps.y, _ps.x, -_ps.y);

    _TMP15.VARt2 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4(_ps.x, _ps.y, -_ps.x, _ps.y);

    _TMP15.VARt3 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4(-_sx, -_sy, _sx, -_sy);

    _TMP15.VARt4 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4(_sx, _sy, -_sx, _sy);

    _TMP15.VARt5 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4(-_ps.x, 0.00000000E+000, _ps.x, 0.00000000E+000);

    _TMP15.VARt6 = vec4(TexCoord.x, TexCoord.y, TexCoord.x, TexCoord.y) + vec4(0.00000000E+000, -_ps.y, 0.00000000E+000, _ps.y);

    VARt1 = _TMP15.VARt1;

    VARt2 = _TMP15.VARt2;

    VARt3 = _TMP15.VARt3;

    VARt4 = _TMP15.VARt4;

    VARt5 = _TMP15.VARt5;

    VARt6 = _TMP15.VARt6;

    gl_Position = _r0019;

    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     vec4 VARt6;

COMPAT_VARYING     vec4 VARt5;

COMPAT_VARYING     vec4 VARt4;

COMPAT_VARYING     vec4 VARt3;

COMPAT_VARYING     vec4 VARt2;

COMPAT_VARYING     vec4 VARt1;





struct tex_coords {

    vec4 VARt1;

    vec4 VARt2;

    vec4 VARt3;

    vec4 VARt4;

    vec4 VARt5;

    vec4 VARt6;

};



struct input_dummy {

    vec2 _video_size;

    vec2 _texture_size;

    vec2 _output_dummy_size;

};



vec4 _ret_0;

float _TMP24;

vec3 _TMP23;

float _TMP22;

vec3 _TMP21;

float _TMP20;

vec3 _TMP19;

float _TMP18;

vec3 _TMP17;

float _TMP16;

vec3 _TMP15;

float _TMP14;

vec3 _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;

tex_coords _co1;

uniform sampler2D Texture;

vec3 _a0056;

vec3 _a0060;

vec3 _a0064;

vec3 _a0068;

vec3 _a0072;

vec3 _a0076;

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()

{



    float _d1;

    float _d2;

    float _hl;

    float _vl;

    float _m1;

    float _m2;

    vec3 _t1;

    vec3 _t2;

    vec3 _TMP28;



    _TMP0 = COMPAT_TEXTURE(Texture, TEX0.xy);

    _TMP1 = COMPAT_TEXTURE(Texture, VARt1.xy);

    _TMP2 = COMPAT_TEXTURE(Texture, VARt1.zw);

    _TMP3 = COMPAT_TEXTURE(Texture, VARt2.xy);

    _TMP4 = COMPAT_TEXTURE(Texture, VARt2.zw);

    _TMP5 = COMPAT_TEXTURE(Texture, VARt3.xy);

    _TMP6 = COMPAT_TEXTURE(Texture, VARt3.zw);

    _TMP7 = COMPAT_TEXTURE(Texture, VARt4.xy);

    _TMP8 = COMPAT_TEXTURE(Texture, VARt4.zw);

    _TMP9 = COMPAT_TEXTURE(Texture, VARt5.xy);

    _TMP10 = COMPAT_TEXTURE(Texture, VARt5.zw);

    _TMP11 = COMPAT_TEXTURE(Texture, VARt6.xy);

    _TMP12 = COMPAT_TEXTURE(Texture, VARt6.zw);

    _a0056 = _TMP1.xyz - _TMP3.xyz;

    _TMP13 = abs(_a0056);

    _TMP14 = dot(_TMP13, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));

    _d1 = _TMP14 + 9.99999975E-005;

    _a0060 = _TMP2.xyz - _TMP4.xyz;

    _TMP15 = abs(_a0060);

    _TMP16 = dot(_TMP15, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));

    _d2 = _TMP16 + 9.99999975E-005;

    _a0064 = _TMP9.xyz - _TMP10.xyz;

    _TMP17 = abs(_a0064);

    _TMP18 = dot(_TMP17, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));

    _hl = _TMP18 + 9.99999975E-005;

    _a0068 = _TMP11.xyz - _TMP12.xyz;

    _TMP19 = abs(_a0068);

    _TMP20 = dot(_TMP19, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));

    _vl = _TMP20 + 9.99999975E-005;

    _a0072 = _TMP1.xyz - _TMP3.xyz;

    _TMP21 = abs(_a0072);

    _TMP22 = dot(_TMP21, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));

    _m1 = _TMP22 + 1.00000005E-003;

    _a0076 = _TMP4.xyz - _TMP2.xyz;

    _TMP23 = abs(_a0076);

    _TMP24 = dot(_TMP23, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));

    _m2 = _TMP24 + 1.00000005E-003;

    _t1 = (_hl*(_TMP11.xyz + _TMP12.xyz) + _vl*(_TMP9.xyz + _TMP10.xyz) + (_hl + _vl)*_TMP0.xyz)/(3.00000000E+000*(_hl + _vl));

    _t2 = (_d1*(_TMP2.xyz + _TMP4.xyz) + _d2*(_TMP1.xyz + _TMP3.xyz) + (_d1 + _d2)*_TMP0.xyz)/(3.00000000E+000*(_d1 + _d2));

    _TMP28 = 2.50000000E-001*(_t1 + _t2 + (_m2*(_TMP5.xyz + _TMP7.xyz) + _m1*(_TMP8.xyz + _TMP6.xyz))/(_m1 + _m2));

    _ret_0 = vec4(_TMP28.x, _TMP28.y, _TMP28.z, 1.00000000E+000);

    FragColor = _ret_0;

    return;

} 
#endif
