mirror of
https://github.com/libretro/RetroArch
synced 2025-02-10 12:40:03 +00:00
122 lines
3.1 KiB
GLSL
122 lines
3.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 vec2 _CT;
|
|
varying vec4 _position2;
|
|
varying vec4 _color;
|
|
varying vec2 _texCoord1;
|
|
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;
|
|
vec2 _texCoord1;
|
|
};
|
|
struct output_dummy {
|
|
vec4 _color;
|
|
};
|
|
struct VERTEX_INPUT {
|
|
vec4 _position2;
|
|
vec2 _CT;
|
|
};
|
|
VERTEX_OUTPUT _ret_0;
|
|
uniform mat4 rubyMVPMatrix;
|
|
vec4 _r0002;
|
|
attribute vec4 rubyVertexCoord;
|
|
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);
|
|
_r0002.x = dot(rubyMVPMatrix_[0], rubyVertexCoord);
|
|
_r0002.y = dot(rubyMVPMatrix_[1], rubyVertexCoord);
|
|
_r0002.z = dot(rubyMVPMatrix_[2], rubyVertexCoord);
|
|
_r0002.w = dot(rubyMVPMatrix_[3], rubyVertexCoord);
|
|
_position1 = _r0002;
|
|
_texCoord1 = rubyTexCoord.xy;
|
|
gl_Position = _r0002;
|
|
TEX0.xy = rubyTexCoord.xy;
|
|
return;
|
|
TEX0.xy = _texCoord1;
|
|
}
|
|
]]></vertex>
|
|
<fragment><![CDATA[
|
|
#ifdef GL_ES
|
|
precision mediump float;
|
|
#endif
|
|
varying vec2 _CT;
|
|
varying vec4 _color;
|
|
varying vec2 _texCoord;
|
|
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 {
|
|
vec2 _texCoord;
|
|
};
|
|
struct output_dummy {
|
|
vec4 _color;
|
|
};
|
|
struct VERTEX_INPUT {
|
|
vec2 _CT;
|
|
};
|
|
vec4 _TMP1;
|
|
vec4 _TMP0;
|
|
uniform sampler2D rubyTexture;
|
|
vec2 _c0008;
|
|
vec2 _c0010;
|
|
varying vec4 TEX0;
|
|
|
|
uniform mediump vec2 rubyOutputSize;
|
|
uniform mediump vec2 rubyTextureSize;
|
|
uniform mediump vec2 rubyInputSize;
|
|
void main()
|
|
{
|
|
vec4 _Color;
|
|
_c0008 = TEX0.xy - 1.00000005E-03;
|
|
_TMP0 = texture2D(rubyTexture, _c0008);
|
|
_Color = vec4( 5.00000000E-01, 5.00000000E-01, 5.00000000E-01, 1.00000000E+00) - _TMP0*2.00000000E+00;
|
|
_c0010 = TEX0.xy + 1.00000005E-03;
|
|
_TMP1 = texture2D(rubyTexture, _c0010);
|
|
_Color = _Color + _TMP1*2.00000000E+00;
|
|
_Color.xyz = vec3((_Color.x + _Color.y + _Color.z)/3.00000000E+00, (_Color.x + _Color.y + _Color.z)/3.00000000E+00, (_Color.x + _Color.y + _Color.z)/3.00000000E+00);
|
|
gl_FragColor = _Color;
|
|
return;
|
|
}
|
|
]]></fragment>
|
|
</shader>
|