all repos — mgba @ ac481d0c1bdfc7e29a650bd163c9802b065da68e

mGBA Game Boy Advance Emulator

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

 1varying vec2 texCoord;
 2uniform sampler2D tex;
 3
 4void main() {
 5	vec4 color = texture2D(tex, texCoord);
 6	vec4 reflection = texture2D(tex, texCoord - vec2(0, 0.025));
 7	vec3 bleed = vec3(0.12, 0.14, 0.19);
 8	vec2 radius = (texCoord.st - vec2(0.5, 0.5)) * vec2(1.6, 1.6);
 9	bleed += (dot(pow(radius, vec2(4.0)), pow(radius, vec2(4.0))) + vec3(0.02, 0.03, 0.05)) * vec3(0.14, 0.18, 0.2);
10	color.rgb += bleed;
11	color.rgb += reflection.rgb * 0.07;
12	color.a = 1.0;
13	gl_FragColor = color;
14}