all repos — mgba @ aa90dbbc92aca9c864e52c89005d9241121a1dc0

mGBA Game Boy Advance Emulator

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

 1varying vec2 texCoord;
 2uniform sampler2D tex;
 3uniform vec2 texSize;
 4
 5void main() {
 6	vec4 color = texture2D(tex, texCoord);
 7	vec3 arrayX[3];
 8	arrayX[0] = vec3(0.2, 0.2, 1.0);
 9	arrayX[1] = vec3(0.2, 1.0, 0.2);
10	arrayX[2] = vec3(1.0, 0.2, 0.2);
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	color.rgb = pow(color.rgb * vec3(0.8, 0.8, 0.8), vec3(1.8, 1.8, 1.8)) + vec3(0.16, 0.16, 0.16);
17	color.rgb *= arrayX[int(mod(texCoord.s * texSize.x * 3.0, 3.0))];
18	color.rgb *= arrayY[int(mod(texCoord.t * texSize.y * 4.0, 4.0))];
19	color.a = 0.5;
20	gl_FragColor = color;
21}