mirror of
https://github.com/libretro/RetroArch
synced 2025-02-13 21:40:27 +00:00
161 lines
4.1 KiB
GLSL
161 lines
4.1 KiB
GLSL
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- XML/GLSL shader autogenerated by cg2xml.py -->
|
|
<shader language="GLSL" style="GLES2">
|
|
<vertex><![CDATA[
|
|
varying vec4 _color;
|
|
varying vec2 _texCoord1;
|
|
varying vec4 _vpos1;
|
|
varying vec4 _position1;
|
|
varying float _frame_rotation;
|
|
varying float _frame_direction;
|
|
varying float _frame_count;
|
|
varying vec2 _output_dummy_size;
|
|
struct input_dummy {
|
|
vec2 _video_size;
|
|
vec2 _texture_size;
|
|
vec2 _output_dummy_size;
|
|
float _frame_count;
|
|
float _frame_direction;
|
|
float _frame_rotation;
|
|
};
|
|
struct VERTEX_OUTPUT {
|
|
vec4 _position1;
|
|
vec4 _vpos1;
|
|
vec2 _texCoord1;
|
|
};
|
|
struct output_dummy {
|
|
vec4 _color;
|
|
};
|
|
VERTEX_OUTPUT _ret_0;
|
|
uniform mat4 rubyMVPMatrix;
|
|
vec4 _r0003;
|
|
attribute vec4 rubyVertexCoord;
|
|
attribute vec4 rubyTexCoord;
|
|
varying vec4 TEX1;
|
|
varying vec4 TEX0;
|
|
|
|
|
|
mat4 transpose_(mat4 matrix)
|
|
{
|
|
mat4 ret;
|
|
for (int i = 0; i < 4; i++)
|
|
for (int j = 0; j < 4; j++)
|
|
ret[i][j] = matrix[j][i];
|
|
|
|
return ret;
|
|
}
|
|
|
|
uniform mediump vec2 rubyOutputSize;
|
|
uniform mediump vec2 rubyTextureSize;
|
|
uniform mediump vec2 rubyInputSize;
|
|
void main()
|
|
{
|
|
mat4 rubyMVPMatrix_ = transpose_(rubyMVPMatrix);
|
|
_r0003.x = dot(rubyMVPMatrix_[0], rubyVertexCoord);
|
|
_r0003.y = dot(rubyMVPMatrix_[1], rubyVertexCoord);
|
|
_r0003.z = dot(rubyMVPMatrix_[2], rubyVertexCoord);
|
|
_r0003.w = dot(rubyMVPMatrix_[3], rubyVertexCoord);
|
|
_position1 = _r0003;
|
|
_vpos1 = _r0003;
|
|
_texCoord1 = rubyTexCoord.xy;
|
|
gl_Position = _r0003;
|
|
TEX1 = _r0003;
|
|
TEX0.xy = rubyTexCoord.xy;
|
|
return;
|
|
TEX1 = _vpos1;
|
|
TEX0.xy = _texCoord1;
|
|
}
|
|
]]></vertex>
|
|
<fragment><![CDATA[
|
|
#ifdef GL_ES
|
|
precision mediump float;
|
|
#endif
|
|
varying vec4 _color;
|
|
varying vec2 _texCoord;
|
|
varying vec4 _vpos;
|
|
varying float _frame_rotation;
|
|
varying float _frame_direction;
|
|
varying float frame_count;
|
|
varying vec2 _output_dummy_size;
|
|
struct input_dummy {
|
|
vec2 _video_size;
|
|
vec2 _texture_size;
|
|
vec2 _output_dummy_size;
|
|
float frame_count;
|
|
float _frame_direction;
|
|
float _frame_rotation;
|
|
};
|
|
struct VERTEX_OUTPUT {
|
|
vec4 _vpos;
|
|
vec2 _texCoord;
|
|
};
|
|
struct output_dummy {
|
|
vec4 _color;
|
|
};
|
|
vec4 _TMP7;
|
|
vec4 _TMP6;
|
|
vec4 _TMP5;
|
|
float _TMP4;
|
|
float _TMP1;
|
|
float _TMP3;
|
|
float _TMP2;
|
|
float _TMP0;
|
|
VERTEX_OUTPUT _TMP8;
|
|
uniform sampler2D rubyTexture;
|
|
uniform input_dummy _IN1;
|
|
vec2 _cc0012;
|
|
float _dist0012;
|
|
float _TMP17;
|
|
float _x0018;
|
|
float _frame_cnt0026;
|
|
vec2 _constant10026;
|
|
float _constant20026;
|
|
float _x0034;
|
|
float _TMP35;
|
|
float _x0036;
|
|
vec2 _c0046;
|
|
vec2 _c0050;
|
|
varying vec4 TEX1;
|
|
varying vec4 TEX0;
|
|
|
|
uniform mediump vec2 rubyOutputSize;
|
|
uniform mediump vec2 rubyTextureSize;
|
|
uniform mediump vec2 rubyInputSize;
|
|
void main()
|
|
{
|
|
output_dummy _OUT;
|
|
vec2 _p;
|
|
float _f;
|
|
vec4 _distortion1;
|
|
_vpos = TEX1/TEX1.w;
|
|
_cc0012 = TEX0.xy - 5.00000000E-01;
|
|
_dist0012 = dot(_cc0012, _cc0012);
|
|
_p = TEX0.xy + _cc0012*(_dist0012 + 7.00000003E-02*_dist0012*_dist0012)*7.00000003E-02;
|
|
_f = (1.00000000E+00 - _vpos.x*_vpos.x)*(1.00000000E+00 - _vpos.y*_vpos.y);
|
|
_TMP0 = pow(_f, 4.39999998E-01);
|
|
_x0018 = 4.80000019E+00*(_TMP0 - 1.59999996E-01);
|
|
_TMP1 = min(1.00000000E+00, _x0018);
|
|
_TMP17 = max(0.00000000E+00, _TMP1);
|
|
_frame_cnt0026 = cos(_IN1.frame_count);
|
|
_constant10026 = _frame_cnt0026*vec2( 1.29090910E+01, 7.82307663E+01);
|
|
_constant20026 = (_frame_cnt0026*4.81344000E+05)/1.10000000E+01;
|
|
_TMP2 = dot(_p, _constant10026);
|
|
_TMP3 = sin(_TMP2);
|
|
_x0034 = _TMP3*_constant20026;
|
|
_TMP4 = fract(_x0034);
|
|
_x0036 = _TMP4 + 2.00000003E-01;
|
|
_TMP1 = min(1.00000000E+00, _x0036);
|
|
_TMP35 = max(0.00000000E+00, _TMP1);
|
|
_c0046 = _p + 7.81250000E-03;
|
|
_TMP5 = texture2D(rubyTexture, _c0046);
|
|
_TMP6 = texture2D(rubyTexture, _p);
|
|
_c0050 = _p - 7.81250000E-03;
|
|
_TMP7 = texture2D(rubyTexture, _c0050);
|
|
_distortion1 = vec4(_TMP5.x, _TMP6.y, _TMP7.z, 1.00000000E+00);
|
|
_OUT._color = _TMP17*(_distortion1*_TMP35);
|
|
gl_FragColor = _OUT._color;
|
|
return;
|
|
}
|
|
]]></fragment>
|
|
</shader>
|