// 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 VARprev;
COMPAT_VARYING     vec2 VARtex;
COMPAT_VARYING     vec2 VARtex_coord;
struct prev {
    vec2 _video_size;
    vec2 VARtexture_size;
float _placeholder29;
    vec2 VARtex_coord;
};
struct input_dummy {
    vec2 _video_size1;
    vec2 VARtexture_size1;
};
struct VertexData {
    vec2 VARtex;
    vec2 VARprev;
};
vec4 _oPosition1;
VertexData _vert1;
prev _PASS21;
vec4 _r0006;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
 
uniform mat4 MVPMatrix;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
COMPAT_ATTRIBUTE vec2 Pass2TexCoord;
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];
    _oPosition1 = _r0006;
    VARtex = TexCoord.xy;
    VARprev = Pass2TexCoord;
    gl_Position = _r0006;
} 
#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 VARprev;
COMPAT_VARYING     vec2 VARtex;
COMPAT_VARYING     vec2 VARtex_coord;
struct prev {
    vec2 _video_size1;
    vec2 VARtexture_size1;
float _placeholder28;
    vec2 VARtex_coord;
};
struct input_dummy {
    vec2 _video_size;
    vec2 VARtexture_size;
};
struct VertexData {
    vec2 VARtex;
    vec2 VARprev;
};
vec4 _ret_0;
vec3 _TMP3;
float _TMP6;
float _TMP5;
float _TMP4;
vec3 _TMP7;
vec4 _TMP1;
vec4 _TMP0;
VertexData _vert1;
uniform sampler2D Texture;
prev _PASS21;
vec3 _TMP19;
 
uniform sampler2D Pass2Texture;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    vec3 _source;
    _TMP0 = COMPAT_TEXTURE(Pass2Texture, VARprev);
    _source = 2.00000000E+00*_TMP0.xyz;
    _TMP1 = COMPAT_TEXTURE(Texture, VARtex);
    _source = _source + 8.99999976E-01*_TMP1.xyz;
    _TMP7 = min(vec3( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00), _source);
    _TMP19 = max(vec3( 0.00000000E+00, 0.00000000E+00, 0.00000000E+00), _TMP7);
    _TMP4 = pow(_TMP19.x, 4.54545438E-01);
    _TMP5 = pow(_TMP19.y, 4.54545438E-01);
    _TMP6 = pow(_TMP19.z, 4.54545438E-01);
    _TMP3 = vec3(_TMP4, _TMP5, _TMP6);
    _ret_0 = vec4(_TMP3.x, _TMP3.y, _TMP3.z, 1.00000000E+00);
    FragColor = _ret_0;
    return;
} 
#endif
