all repos — mgba @ 782f6191e51b16211d1f783d0ae61aac722c54d3

mGBA Game Boy Advance Emulator

res/shaders/ags001.shader/ags001.fs (view raw)

 1varying vec2 texCoord;
 2uniform sampler2D tex;
 3
 4void main() {
 5	vec4 color = texture2D(tex, texCoord);
 6	vec3 arrayX[4];
 7	arrayX[0] = vec3(1.0, 0.2, 0.2);
 8	arrayX[1] = vec3(0.2, 1.0, 0.2);
 9	arrayX[2] = vec3(0.2, 0.2, 1.0);
10	arrayX[3] = vec3(0.4, 0.4, 0.4);
11	vec3 arrayY[4];
12	arrayY[0] = vec3(1.0, 1.0, 1.0);
13	arrayY[1] = vec3(1.0, 1.0, 1.0);
14	arrayY[2] = vec3(1.0, 1.0, 1.0);
15	arrayY[3] = vec3(0.8, 0.8, 0.8);
16	vec3 bleed = vec3(0.7, 0.7, 0.7);
17	vec2 radius = (texCoord.st - vec2(0.5, 0.5)) * vec2(1.5, 1.5);
18	bleed += (pow(dot(radius, radius), 3.0) + vec3(0.06, 0.1, 0.2)) * vec3(0.8, 0.88, 1.2);
19	color.rgb = pow(color.rgb + vec3(0.1, 0.12, 0.2), vec3(1.6, 1.6, 1.6)) * bleed;
20	color.rgb *= arrayX[int(mod(texCoord.s * 960.0, 4.0))];
21	color.rgb *= arrayY[int(mod(texCoord.t * 640.0, 4.0))];
22	color.rgb += vec3(0.16, 0.18, 0.22);
23	color.a = 0.5;
24	gl_FragColor = color;
25}