// 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     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;
};
out_vertex _ret_0;
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()
{
    _r0006 = VertexCoord.x*MVPMatrix[0];
    _r0006 = _r0006 + VertexCoord.y*MVPMatrix[1];
    _r0006 = _r0006 + VertexCoord.z*MVPMatrix[2];
    _r0006 = _r0006 + VertexCoord.w*MVPMatrix[3];
    _ret_0._position1 = _r0006;
    _ret_0._color1 = COLOR;
    _ret_0._texCoord1 = TexCoord.xy;
    gl_Position = _r0006;
    COL0 = COLOR;
    TEX0.xy = TexCoord.xy;
    return;
    COL0 = _ret_0._color1;
    TEX0.xy = _ret_0._texCoord1;
} 
#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     vec2 _texCoord;
COMPAT_VARYING     vec4 _color2;
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 _color2;
    vec2 _texCoord;
};
vec4 _ret_0;
vec3 _TMP2;
float _TMP5;
float _TMP4;
float _TMP3;
vec3 _TMP1;
vec3 _TMP8;
float _TMP6;
float _TMP7;
vec4 _TMP0;
uniform sampler2D Texture;
input_dummy _IN1;
vec2 _x0014;
float _r0026;
vec3 _delta0026;
vec3 _weight0026;
vec3 _TMP37;
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 _position;
    vec3 _color1;
    _x0014 = TEX0.xy*TextureSize;
    _position = fract(_x0014);
    _TMP0 = COMPAT_TEXTURE(Texture, TEX0.xy);
    _TMP3 = pow(_TMP0.x, 2.40000010E+00);
    _TMP4 = pow(_TMP0.y, 2.40000010E+00);
    _TMP5 = pow(_TMP0.z, 2.40000010E+00);
    _color1 = vec3(_TMP3, _TMP4, _TMP5);
    _TMP6 = dot(_position, vec2( 1.00000000E+00, 1.00000000E+00));
    _TMP7 = inversesqrt(_TMP6);
    _r0026 = 1.00000000E+00/_TMP7;
    _delta0026 = vec3( 2.00000003E-01, 2.00000003E-01, 2.00000003E-01) + _color1*vec3( 6.00000024E-01, 6.00000024E-01, 6.00000024E-01);
    _weight0026 = _delta0026*(1.00000000E+00 - _r0026);
    _TMP1 = _color1 + _weight0026;
    _TMP8 = min(vec3( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00), _TMP1);
    _TMP37 = max(vec3( 0.00000000E+00, 0.00000000E+00, 0.00000000E+00), _TMP8);
    _TMP3 = pow(_TMP37.x, 4.54545438E-01);
    _TMP4 = pow(_TMP37.y, 4.54545438E-01);
    _TMP5 = pow(_TMP37.z, 4.54545438E-01);
    _TMP2 = vec3(_TMP3, _TMP4, _TMP5);
    _ret_0 = vec4(_TMP2.x, _TMP2.y, _TMP2.z, 1.00000000E+00);
    FragColor = _ret_0;
    return;
} 
#endif
