Gobligine/tools/shaders/sharp-bilinear.cg.glsl
2016-05-26 01:57:32 +02:00

108 lines
2.6 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
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _oPosition1;
vec4 _r0005;
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 _otexCoord;
_r0005 = gl_Vertex.x*gl_ModelViewProjectionMatrix[0];
_r0005 = _r0005 + gl_Vertex.y*gl_ModelViewProjectionMatrix[1];
_r0005 = _r0005 + gl_Vertex.z*gl_ModelViewProjectionMatrix[2];
_r0005 = _r0005 + gl_Vertex.w*gl_ModelViewProjectionMatrix[3];
_oPosition1 = _r0005;
_otexCoord = gl_MultiTexCoord0.xy;
gl_Position = _r0005;
TEX0.xy = gl_MultiTexCoord0.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
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _ret_0;
vec2 _TMP1;
uniform sampler2D Texture;
input_dummy _IN1;
vec2 _TMP8;
vec2 _c0015;
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 _texel;
vec2 _texel_floored;
vec2 _s;
vec2 _center_dist;
vec2 _f;
vec2 _mod_texel;
_texel = TEX0.xy*TextureSize;
_texel_floored = floor(_texel);
_s = fract(_texel);
_center_dist = _s - 5.00000000E-01;
_TMP1 = min(vec2( 3.75000000E-01, 3.75000000E-01), _center_dist);
_TMP8 = max(vec2( -3.75000000E-01, -3.75000000E-01), _TMP1);
_f = (_center_dist - _TMP8)*4.00000000E+00 + 5.00000000E-01;
_mod_texel = _texel_floored + _f;
_c0015 = _mod_texel/TextureSize;
_ret_0 = COMPAT_TEXTURE(Texture, _c0015);
FragColor = _ret_0;
return;
}
#endif