Res: Improve modeling of AGB/AGS screen in shaders

This commit is contained in:
Vicki Pfau 2019-01-04 21:48:21 -08:00
parent 6617a9dccd
commit aa90dbbc92
5 changed files with 13 additions and 14 deletions

View File

@ -7,7 +7,6 @@ Misc:
- GBA Savedata: EEPROM performance fixes - GBA Savedata: EEPROM performance fixes
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
- GB Memory: Support running from blocked memory - GB Memory: Support running from blocked memory
- GB Audio: Skip frame if enabled when clock is high
0.7.0: (Future) 0.7.0: (Future)
Features: Features:
@ -160,6 +159,8 @@ Misc:
- Qt: Minor memory view tweaks - Qt: Minor memory view tweaks
- CMake: Fix libswresample version dependencies (fixes mgba.io/i/1229) - CMake: Fix libswresample version dependencies (fixes mgba.io/i/1229)
- Debugger: Readability improvements (fixes mgba.io/i/1238) - Debugger: Readability improvements (fixes mgba.io/i/1238)
- GB Audio: Skip frame if enabled when clock is high
- Res: Improve modeling of AGB/AGS screen in shaders
0.7 beta 1: (2018-09-24) 0.7 beta 1: (2018-09-24)
- Initial beta for 0.7 - Initial beta for 0.7

View File

@ -4,18 +4,17 @@ uniform vec2 texSize;
void main() { void main() {
vec4 color = texture2D(tex, texCoord); vec4 color = texture2D(tex, texCoord);
vec3 arrayX[4]; vec3 arrayX[3];
arrayX[0] = vec3(1.0, 0.2, 0.2); arrayX[0] = vec3(0.2, 0.2, 1.0);
arrayX[1] = vec3(0.2, 1.0, 0.2); arrayX[1] = vec3(0.2, 1.0, 0.2);
arrayX[2] = vec3(0.2, 0.2, 1.0); arrayX[2] = vec3(1.0, 0.2, 0.2);
arrayX[3] = vec3(0.4, 0.4, 0.4);
vec3 arrayY[4]; vec3 arrayY[4];
arrayY[0] = vec3(1.0, 1.0, 1.0); arrayY[0] = vec3(1.0, 1.0, 1.0);
arrayY[1] = 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[2] = vec3(1.0, 1.0, 1.0);
arrayY[3] = vec3(0.8, 0.8, 0.8); arrayY[3] = vec3(0.8, 0.8, 0.8);
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); 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);
color.rgb *= arrayX[int(mod(texCoord.s * texSize.x * 4.0, 4.0))]; color.rgb *= arrayX[int(mod(texCoord.s * texSize.x * 3.0, 3.0))];
color.rgb *= arrayY[int(mod(texCoord.t * texSize.y * 4.0, 4.0))]; color.rgb *= arrayY[int(mod(texCoord.t * texSize.y * 4.0, 4.0))];
color.a = 0.5; color.a = 0.5;
gl_FragColor = color; gl_FragColor = color;

View File

@ -7,5 +7,5 @@ passes=1
[pass.0] [pass.0]
fragmentShader=agb001.fs fragmentShader=agb001.fs
blend=1 blend=1
width=-4 width=-3
height=-4 height=-4

View File

@ -4,18 +4,17 @@ uniform vec2 texSize;
void main() { void main() {
vec4 color = texture2D(tex, texCoord); vec4 color = texture2D(tex, texCoord);
vec3 arrayX[4]; vec3 arrayX[3];
arrayX[0] = vec3(1.0, 0.2, 0.2); arrayX[0] = vec3(0.2, 0.2, 1.0);
arrayX[1] = vec3(0.2, 1.0, 0.2); arrayX[1] = vec3(0.2, 1.0, 0.2);
arrayX[2] = vec3(0.2, 0.2, 1.0); arrayX[2] = vec3(1.0, 0.2, 0.2);
arrayX[3] = vec3(0.4, 0.4, 0.4);
vec3 arrayY[4]; vec3 arrayY[4];
arrayY[0] = vec3(1.0, 1.0, 1.0); arrayY[0] = vec3(1.0, 1.0, 1.0);
arrayY[1] = 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[2] = vec3(1.0, 1.0, 1.0);
arrayY[3] = vec3(0.9, 0.9, 0.9); arrayY[3] = vec3(0.9, 0.9, 0.9);
color.rgb = pow(color.rgb, vec3(1.6, 1.6, 1.6)); color.rgb = pow(color.rgb, vec3(1.6, 1.6, 1.6));
color.rgb *= arrayX[int(mod(texCoord.s * texSize.x * 4.0, 4.0))]; color.rgb *= arrayX[int(mod(texCoord.s * texSize.x * 3.0, 3.0))];
color.rgb *= arrayY[int(mod(texCoord.t * texSize.y * 4.0, 4.0))]; color.rgb *= arrayY[int(mod(texCoord.t * texSize.y * 4.0, 4.0))];
color.a = 0.8; color.a = 0.8;
gl_FragColor = color; gl_FragColor = color;

View File

@ -7,12 +7,12 @@ passes=2
[pass.0] [pass.0]
fragmentShader=ags001.fs fragmentShader=ags001.fs
blend=1 blend=1
width=-4 width=-3
height=-4 height=-4
[pass.1] [pass.1]
fragmentShader=ags001-light.fs fragmentShader=ags001-light.fs
width=-4 width=-3
height=-4 height=-4
[pass.1.uniform.lightBrightness] [pass.1.uniform.lightBrightness]