Gobligine/tools/shaders/crt-hyllian-fast.cg.glsl
2016-05-26 01:57:32 +02:00

177 lines
4.7 KiB
GLSL

// 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 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 _texCoord1;
};
vec4 _oPosition1;
out_vertex _ret_0;
input_dummy _IN1;
vec4 _r0008;
COMPAT_ATTRIBUTE vec4 gl_Vertex;
COMPAT_ATTRIBUTE vec4 gl_MultiTexCoord0;
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 _ps;
out_vertex _TMP3;
_ps = 1.00000000E+00/TextureSize;
_r0008 = gl_Vertex.x*gl_ModelViewProjectionMatrix[0];
_r0008 = _r0008 + gl_Vertex.y*gl_ModelViewProjectionMatrix[1];
_r0008 = _r0008 + gl_Vertex.z*gl_ModelViewProjectionMatrix[2];
_r0008 = _r0008 + gl_Vertex.w*gl_ModelViewProjectionMatrix[3];
_oPosition1 = _r0008;
_TMP3._texCoord1 = gl_MultiTexCoord0.xy + _ps*vec2( -4.90000010E-01, 0.00000000E+00);
_ret_0._texCoord1 = _TMP3._texCoord1;
gl_Position = _r0008;
TEX0.xy = _TMP3._texCoord1;
return;
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 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 _texCoord;
};
vec4 _ret_0;
vec3 _TMP6;
float _TMP9;
float _TMP8;
float _TMP7;
float _TMP5;
float _TMP10;
vec4 _TMP4;
vec4 _TMP3;
vec4 _TMP2;
vec4 _TMP1;
vec2 _TMP0;
uniform sampler2D Texture;
input_dummy _IN1;
vec2 _x0019;
vec2 _x0021;
vec2 _c0023;
vec2 _c0027;
vec2 _c0029;
vec4 _r0031;
vec4 _v0031;
vec3 _r0041;
float _a0051;
float _x0053;
float _TMP56;
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 _dx;
vec2 _tc;
vec2 _fp;
vec3 _color;
float _d;
_dx = vec2(1.00000000E+00/TextureSize.x, 0.00000000E+00);
_x0019 = TEX0.xy*TextureSize;
_TMP0 = floor(_x0019);
_tc = (_TMP0 + vec2( 5.00000000E-01, 5.00000000E-01))/TextureSize;
_x0021 = TEX0.xy*TextureSize;
_fp = fract(_x0021);
_c0023 = _tc - _dx;
_TMP1 = COMPAT_TEXTURE(Texture, _c0023);
_TMP2 = COMPAT_TEXTURE(Texture, _tc);
_c0027 = _tc + _dx;
_TMP3 = COMPAT_TEXTURE(Texture, _c0027);
_c0029 = _tc + 2.00000000E+00*_dx;
_TMP4 = COMPAT_TEXTURE(Texture, _c0029);
_v0031 = vec4(_fp.x*_fp.x*_fp.x, _fp.x*_fp.x, _fp.x, 1.00000000E+00);
_r0031.x = dot(vec4( -5.00000000E-01, 1.00000000E+00, -5.00000000E-01, 0.00000000E+00), _v0031);
_r0031.y = dot(vec4( 1.50000000E+00, -2.50000000E+00, 0.00000000E+00, 1.00000000E+00), _v0031);
_r0031.z = dot(vec4( -1.50000000E+00, 2.00000000E+00, 5.00000000E-01, 0.00000000E+00), _v0031);
_r0031.w = dot(vec4( 5.00000000E-01, -5.00000000E-01, 0.00000000E+00, 0.00000000E+00), _v0031);
_r0041 = _r0031.x*_TMP1.xyz;
_r0041 = _r0041 + _r0031.y*_TMP2.xyz;
_r0041 = _r0041 + _r0031.z*_TMP3.xyz;
_r0041 = _r0041 + _r0031.w*_TMP4.xyz;
_TMP7 = pow(_r0041.x, 2.40000010E+00);
_TMP8 = pow(_r0041.y, 2.40000010E+00);
_TMP9 = pow(_r0041.z, 2.40000010E+00);
_color = vec3(_TMP7, _TMP8, _TMP9);
_a0051 = _fp.y - 5.00000000E-01;
_TMP5 = abs(_a0051);
_x0053 = 1.00000000E+00 - _TMP5;
_TMP10 = min(1.00000000E+00, _x0053);
_TMP56 = max(0.00000000E+00, _TMP10);
_d = _TMP56*_TMP56*(3.00000000E+00 - 2.00000000E+00*_TMP56);
_color = _color*_d;
_TMP7 = pow(_color.x, 4.54545438E-01);
_TMP8 = pow(_color.y, 4.54545438E-01);
_TMP9 = pow(_color.z, 4.54545438E-01);
_TMP6 = vec3(_TMP7, _TMP8, _TMP9);
_ret_0 = vec4(_TMP6.x, _TMP6.y, _TMP6.z, 1.00000000E+00);
FragColor = _ret_0;
return;
}
#endif