all repos — mgba @ d160647fff2c42fcbaf19122469b749a0b355c29

mGBA Game Boy Advance Emulator

Resources: Add AGS-001 filter
Jeffrey Pfau jeffrey@endrift.com
Sun, 01 Nov 2015 18:43:01 -0800
commit

d160647fff2c42fcbaf19122469b749a0b355c29

parent

096f5ca27c52d1d0aa14b5641791c9b24ac88f3a

2 files changed, 35 insertions(+), 0 deletions(-)

jump to
A res/shaders/ags001.shader/ags001.fs

@@ -0,0 +1,24 @@

+varying vec2 texCoord; +uniform sampler2D tex; + +void main() { + vec4 color = texture2D(tex, texCoord); + vec3 arrayX[4]; + arrayX[0] = vec3(1.0, 0.2, 0.2); + arrayX[1] = vec3(0.2, 1.0, 0.2); + arrayX[2] = vec3(0.2, 0.2, 1.0); + arrayX[3] = vec3(0.4, 0.4, 0.4); + vec3 arrayY[4]; + arrayY[0] = vec3(1.0, 1.0, 1.0); + arrayY[1] = vec3(1.0, 1.0, 1.0); + arrayY[2] = vec3(1.0, 1.0, 1.0); + arrayY[3] = vec3(0.8, 0.8, 0.8); + vec3 bleed = vec3(0.7, 0.7, 0.7); + vec2 radius = (texCoord.st - vec2(0.5, 0.5)) * vec2(1.5, 1.5); + bleed += (pow(dot(radius, radius), 3.0) + vec3(0.06, 0.1, 0.2)) * vec3(0.8, 0.88, 1.2); + color.rgb = pow(color.rgb + vec3(0.1, 0.12, 0.2), vec3(1.6, 1.6, 1.6)) * bleed + vec3(0.16, 0.18, 0.22); + color.rgb *= arrayX[int(mod(texCoord.s * 960.0, 4.0))]; + color.rgb *= arrayY[int(mod(texCoord.t * 640.0, 4.0))]; + color.a = 0.5; + gl_FragColor = color; +}
A res/shaders/ags001.shader/manifest.ini

@@ -0,0 +1,11 @@

+[shader] +name=AGS-001 +author=endrift +description=A pristine recreation of the illumated Game Boy Advance SP +passes=1 + +[pass.0] +fragmentShader=ags001.fs +blend=1 +width=960 +height=640