mirror of
https://github.com/libretro/RetroArch
synced 2025-02-10 12:40:03 +00:00
114 lines
2.8 KiB
GLSL
114 lines
2.8 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 _color1;
|
|
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 output_dummy {
|
|
vec4 _color1;
|
|
};
|
|
vec4 _oPosition1;
|
|
uniform mat4 rubyMVPMatrix;
|
|
uniform input_dummy _IN1;
|
|
vec4 _r0004;
|
|
attribute vec4 rubyVertexCoord;
|
|
attribute vec4 COLOR;
|
|
varying vec4 COL0;
|
|
attribute vec4 rubyTexCoord;
|
|
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);
|
|
vec4 _oColor;
|
|
vec2 _oTex;
|
|
vec2 _scale;
|
|
vec2 _middle;
|
|
vec2 _diff;
|
|
_r0004.x = dot(rubyMVPMatrix_[0], rubyVertexCoord);
|
|
_r0004.y = dot(rubyMVPMatrix_[1], rubyVertexCoord);
|
|
_r0004.z = dot(rubyMVPMatrix_[2], rubyVertexCoord);
|
|
_r0004.w = dot(rubyMVPMatrix_[3], rubyVertexCoord);
|
|
_oPosition1 = _r0004;
|
|
_oColor = COLOR;
|
|
_scale = rubyOutputSize/rubyInputSize;
|
|
_middle = (5.00000000E-01*rubyInputSize)/rubyTextureSize;
|
|
_diff = rubyTexCoord.xy - _middle;
|
|
_oTex = _middle + _diff*_scale;
|
|
gl_Position = _r0004;
|
|
COL0 = COLOR;
|
|
TEX0.xy = _oTex;
|
|
}
|
|
]]></vertex>
|
|
<fragment><![CDATA[
|
|
#ifdef GL_ES
|
|
precision mediump float;
|
|
#endif
|
|
varying vec4 _color;
|
|
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 output_dummy {
|
|
vec4 _color;
|
|
};
|
|
vec4 _TMP1;
|
|
vec4 _TMP0;
|
|
uniform sampler2D rubyTexture;
|
|
vec2 _c0007;
|
|
vec2 _c0009;
|
|
varying vec4 TEX0;
|
|
|
|
uniform mediump vec2 rubyOutputSize;
|
|
uniform mediump vec2 rubyTextureSize;
|
|
uniform mediump vec2 rubyInputSize;
|
|
void main()
|
|
{
|
|
vec4 _Color;
|
|
_Color = texture2D(rubyTexture, TEX0.xy);
|
|
_c0007 = TEX0.xy + 9.99999975E-05;
|
|
_TMP0 = texture2D(rubyTexture, _c0007);
|
|
_Color = _Color - _TMP0*5.00000000E+00;
|
|
_c0009 = TEX0.xy - 9.99999975E-05;
|
|
_TMP1 = texture2D(rubyTexture, _c0009);
|
|
_Color = _Color + _TMP1*5.00000000E+00;
|
|
_Color.w = 1.00000000E+00;
|
|
gl_FragColor = _Color;
|
|
return;
|
|
}
|
|
]]></fragment>
|
|
</shader>
|