mirror of https://github.com/mgba-emu/mgba.git
79 lines
2.9 KiB
Plaintext
79 lines
2.9 KiB
Plaintext
|
/*
|
||
|
Hyllian's xBR-lv3 Shader
|
||
|
|
||
|
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
|
||
|
|
||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
|
of this software and associated documentation files (the "Software"), to deal
|
||
|
in the Software without restriction, including without limitation the rights
|
||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
|
copies of the Software, and to permit persons to whom the Software is
|
||
|
furnished to do so, subject to the following conditions:
|
||
|
|
||
|
The above copyright notice and this permission notice shall be included in
|
||
|
all copies or substantial portions of the Software.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||
|
THE SOFTWARE.
|
||
|
|
||
|
|
||
|
Incorporates some of the ideas from SABR shader. Thanks to Joshua Street.
|
||
|
*/
|
||
|
// GLSL shader autogenerated by cg2glsl.py.
|
||
|
#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 vec4 _t7;
|
||
|
COMPAT_VARYING vec4 _t6;
|
||
|
COMPAT_VARYING vec4 _t5;
|
||
|
COMPAT_VARYING vec4 _t4;
|
||
|
COMPAT_VARYING vec4 _t3;
|
||
|
COMPAT_VARYING vec4 _t2;
|
||
|
COMPAT_VARYING vec4 _t1;
|
||
|
vec4 _r0007;
|
||
|
COMPAT_ATTRIBUTE vec4 position;
|
||
|
COMPAT_VARYING vec4 COL0;
|
||
|
COMPAT_VARYING vec4 TEX0;
|
||
|
COMPAT_VARYING vec4 TEX1;
|
||
|
COMPAT_VARYING vec4 TEX2;
|
||
|
COMPAT_VARYING vec4 TEX3;
|
||
|
COMPAT_VARYING vec4 TEX4;
|
||
|
COMPAT_VARYING vec4 TEX5;
|
||
|
COMPAT_VARYING vec4 TEX6;
|
||
|
COMPAT_VARYING vec4 TEX7;
|
||
|
const COMPAT_PRECISION vec2 TextureSize = vec2(240.0, 160.0);
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
vec2 _ps;
|
||
|
vec2 _texCoord;
|
||
|
_ps = vec2(1.00000000E+00/TextureSize.x, 1.00000000E+00/TextureSize.y);
|
||
|
_texCoord = (position.st + vec2(1.0, 1.0)) * vec2(0.5, 0.5) + vec2( 1.00000001E-07, 1.00000001E-07);
|
||
|
gl_Position = position;
|
||
|
TEX0.xy = _texCoord;
|
||
|
TEX1 = _texCoord.xxxy + vec4(-_ps.x, 0.00000000E+00, _ps.x, -2.00000000E+00*_ps.y);
|
||
|
TEX2 = _texCoord.xxxy + vec4(-_ps.x, 0.00000000E+00, _ps.x, -_ps.y);
|
||
|
TEX3 = _texCoord.xxxy + vec4(-_ps.x, 0.00000000E+00, _ps.x, 0.00000000E+00);
|
||
|
TEX4 = _texCoord.xxxy + vec4(-_ps.x, 0.00000000E+00, _ps.x, _ps.y);
|
||
|
TEX5 = _texCoord.xxxy + vec4(-_ps.x, 0.00000000E+00, _ps.x, 2.00000000E+00*_ps.y);
|
||
|
TEX6 = _texCoord.xyyy + vec4(-2.00000000E+00*_ps.x, -_ps.y, 0.00000000E+00, _ps.y);
|
||
|
TEX7 = _texCoord.xyyy + vec4(2.00000000E+00*_ps.x, -_ps.y, 0.00000000E+00, _ps.y);
|
||
|
}
|