Shaders: Touch up AGS-001 shader, add annoying reflection

This commit is contained in:
Jeffrey Pfau 2015-11-08 15:29:52 -08:00
parent 5ddebf5d81
commit ad3ec31f73
3 changed files with 23 additions and 8 deletions

View File

@ -0,0 +1,14 @@
varying vec2 texCoord;
uniform sampler2D tex;
void main() {
vec4 color = texture2D(tex, texCoord);
vec4 reflection = texture2D(tex, texCoord - vec2(0, 0.025));
vec3 bleed = vec3(0.12, 0.14, 0.19);
vec2 radius = (texCoord.st - vec2(0.5, 0.5)) * vec2(1.6, 1.6);
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);
color.rgb += bleed;
color.rgb += reflection.rgb * 0.07;
color.a = 1.0;
gl_FragColor = color;
}

View File

@ -12,14 +12,10 @@ void main() {
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.12, 0.14, 0.19);
vec2 radius = (texCoord.st - vec2(0.5, 0.5)) * vec2(2.0, 2.0);
bleed += (dot(pow(radius, vec2(4.0)), pow(radius, vec2(4.0))) + vec3(0.06, 0.1, 0.2)) * vec3(0.18, 0.2, 0.32);
color.rgb = pow(color.rgb + vec3(0.1, 0.12, 0.2), vec3(1.6, 1.6, 1.6));
arrayY[3] = vec3(0.9, 0.9, 0.9);
color.rgb = pow(color.rgb, vec3(1.6, 1.6, 1.6));
color.rgb *= arrayX[int(mod(texCoord.s * 960.0, 4.0))];
color.rgb *= arrayY[int(mod(texCoord.t * 640.0, 4.0))];
color.rgb += bleed;
color.a = 0.5;
color.a = 0.8;
gl_FragColor = color;
}

View File

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