Shaders: Touch up AGS-001 shader, add annoying reflection
Jeffrey Pfau jeffrey@endrift.com
Sun, 08 Nov 2015 15:29:52 -0800
3 files changed,
23 insertions(+),
8 deletions(-)
A
res/shaders/ags001.shader/ags001-light.fs
@@ -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; +}
M
res/shaders/ags001.shader/ags001.fs
→
res/shaders/ags001.shader/ags001.fs
@@ -12,14 +12,10 @@ 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.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; }
M
res/shaders/ags001.shader/manifest.ini
→
res/shaders/ags001.shader/manifest.ini
@@ -2,10 +2,15 @@ [shader]
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