// 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 _blur_dxdy;
COMPAT_VARYING     vec2 _tex_uv1;
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;
    vec2 _tex_uv1;
    vec2 _blur_dxdy;
};
out_vertex _ret_0;
input_dummy _IN1;
vec4 _r0006;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
 
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 _OUT;
    vec2 _dxdy_scale;
    _r0006 = VertexCoord.x*MVPMatrix[0];
    _r0006 = _r0006 + VertexCoord.y*MVPMatrix[1];
    _r0006 = _r0006 + VertexCoord.z*MVPMatrix[2];
    _r0006 = _r0006 + VertexCoord.w*MVPMatrix[3];
    _dxdy_scale = InputSize/OutputSize;
    _OUT._blur_dxdy = _dxdy_scale/TextureSize;
    _ret_0._position1 = _r0006;
    _ret_0._tex_uv1 = TexCoord.xy;
    _ret_0._blur_dxdy = _OUT._blur_dxdy;
    gl_Position = _r0006;
    TEX0.xy = TexCoord.xy;
    TEX1.xy = _OUT._blur_dxdy;
    return;
    TEX0.xy = _ret_0._tex_uv1;
    TEX1.xy = _ret_0._blur_dxdy;
} 
#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 _blur_dxdy;
COMPAT_VARYING     vec2 _tex_uv1;
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 {
    vec2 _tex_uv1;
    vec2 _blur_dxdy;
};
vec4 _TMP12;
float _TMP2;
float _TMP1;
float _TMP0;
uniform sampler2D Texture;
vec3 _TMP17;
float _texel1to2ratio0020;
vec2 _sample1R_texel_offset0020;
vec2 _sample2d_texel_offset0020;
float _w10020;
float _w20020;
float _weight_sum_inv0020;
vec2 _dxdy_mirror_x0020;
vec2 _dxdy_mirror_y0020;
vec2 _dxdy_mirror_xy0020;
vec3 _sample0C0020;
vec3 _sample1R0020;
vec3 _sample1D0020;
vec3 _sample1L0020;
vec3 _sample1U0020;
vec3 _sample2d0020;
vec3 _sample2c0020;
vec3 _sample2b0020;
vec3 _sum0020;
float _TMP21;
float _TMP25;
float _TMP31;
float _x0032;
float _TMP37;
float _x0038;
float _TMP43;
float _x0044;
vec2 _tex_coords0054;
vec2 _tex_coords0060;
vec2 _tex_coords0066;
vec2 _tex_coords0072;
vec2 _tex_coords0078;
vec2 _tex_coords0084;
vec2 _tex_coords0090;
vec2 _tex_coords0096;
vec4 _color0102;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
 
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    _TMP21 = pow(2.71828198E+00, -5.15794277E-01);
    _TMP25 = pow(2.71828198E+00, -2.06317711E+00);
    _texel1to2ratio0020 = _TMP25/(_TMP21 + _TMP25);
    _sample1R_texel_offset0020 = vec2( 1.00000000E+00, 0.00000000E+00) + vec2(_texel1to2ratio0020, 0.00000000E+00);
    _sample2d_texel_offset0020 = vec2( 1.00000000E+00, 1.00000000E+00) + vec2(_texel1to2ratio0020, _texel1to2ratio0020);
    _TMP0 = dot(vec2( 1.00000000E+00, 1.00000000E+00), vec2( 1.00000000E+00, 1.00000000E+00));
    _x0032 = -_TMP0*5.15794277E-01;
    _TMP31 = pow(2.71828198E+00, _x0032);
    _TMP1 = dot(vec2( 2.00000000E+00, 1.00000000E+00), vec2( 2.00000000E+00, 1.00000000E+00));
    _x0038 = -_TMP1*5.15794277E-01;
    _TMP37 = pow(2.71828198E+00, _x0038);
    _TMP2 = dot(vec2( 2.00000000E+00, 2.00000000E+00), vec2( 2.00000000E+00, 2.00000000E+00));
    _x0044 = -_TMP2*5.15794277E-01;
    _TMP43 = pow(2.71828198E+00, _x0044);
    _w10020 = _TMP21 + _TMP25;
    _w20020 = _TMP31 + 2.00000000E+00*_TMP37 + _TMP43;
    _weight_sum_inv0020 = 1.00000000E+00/(1.00000000E+00 + 4.00000000E+00*(_w10020 + _w20020));
    _dxdy_mirror_x0020 = TEX1.xy*vec2( -1.00000000E+00, 1.00000000E+00);
    _dxdy_mirror_y0020 = TEX1.xy*vec2( 1.00000000E+00, -1.00000000E+00);
    _dxdy_mirror_xy0020 = -TEX1.xy;
    _TMP12 = COMPAT_TEXTURE(Texture, TEX0.xy);
    _sample0C0020 = _TMP12.xyz;
    _tex_coords0054 = TEX0.xy + TEX1.xy*_sample1R_texel_offset0020;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0054);
    _sample1R0020 = _TMP12.xyz;
    _tex_coords0060 = TEX0.xy + TEX1.xy*_sample1R_texel_offset0020.yx;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0060);
    _sample1D0020 = _TMP12.xyz;
    _tex_coords0066 = TEX0.xy - TEX1.xy*_sample1R_texel_offset0020;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0066);
    _sample1L0020 = _TMP12.xyz;
    _tex_coords0072 = TEX0.xy - TEX1.xy*_sample1R_texel_offset0020.yx;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0072);
    _sample1U0020 = _TMP12.xyz;
    _tex_coords0078 = TEX0.xy + TEX1.xy*_sample2d_texel_offset0020;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0078);
    _sample2d0020 = _TMP12.xyz;
    _tex_coords0084 = TEX0.xy + _dxdy_mirror_x0020*_sample2d_texel_offset0020;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0084);
    _sample2c0020 = _TMP12.xyz;
    _tex_coords0090 = TEX0.xy + _dxdy_mirror_y0020*_sample2d_texel_offset0020;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0090);
    _sample2b0020 = _TMP12.xyz;
    _tex_coords0096 = TEX0.xy + _dxdy_mirror_xy0020*_sample2d_texel_offset0020;
    _TMP12 = COMPAT_TEXTURE(Texture, _tex_coords0096);
    _sum0020 = _sample0C0020 + _w10020*(_sample1R0020 + _sample1D0020 + _sample1L0020 + _sample1U0020);
    _sum0020 = _sum0020 + _w20020*(_TMP12.xyz + _sample2b0020 + _sample2c0020 + _sample2d0020);
    _TMP17 = _sum0020*_weight_sum_inv0020;
    _color0102 = vec4(_TMP17.x, _TMP17.y, _TMP17.z, 1.00000000E+00);
    FragColor = _color0102;
    return;
} 
#endif
